Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Multiple combo boxes

Discussion in 'Information Technology' started by Jenn, Jul 28, 2006.

  1. Jenn

    Jenn
    Expand Collapse
    Guest

    I need to do the following in a database. I have a table that has values
    that populate a combo box and these values get stored in another table. For
    the example lets say these values in the combo lookup table are "fruits",
    "Veggies", and Junk Food". So I have a combo box on a form that is populated
    with these three values that the user can select from. What i want to do
    next is have a second combo box which will have a secondary selection. For
    instance, let's say the user selects "Veggies", I want the second combo box
    to populate with the selection "carrots", "peas", and "broccoli". If the
    user selects "Junk Food" in the first combo box I want the second combo box
    to have the selections "Pizza", "Chips" and "Cake".
    So how would I do this? I am assuming I need to set up a different look up
    table for the selection under "Fruits", and one for selections for "veggies"
    and one for "Junk Food". I just dont know how to get a 2nd combo box to 1)
    read what is going on with the first box and 2) how to get the second box to
    allow the correct selections.
    Any help would be greately appreciate!
    TIA!
     
  2. Loading...


  3. Svetlana

    Svetlana
    Expand Collapse
    Guest

    Change the rowsource of the second combobox to something like
    SELECT .........................................
    FROM ........................
    WHERE (((NameOfTable.NameOfField)=[Forms]![FormName]![cbo1]));
    Then on GotFocus event of the second combobox put the code
    cbo2.Requery
     

Share This Page