Multiple combo boxes

G

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!
 
S

Svetlana

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top