You mean like a combo box? Well... for the subcatagory, each possible choice
is ideally stored in a table that has a field that also references when the
catagory is. For instance:
tblCatagories might have a field called fldCatagory with these records:
Fruits
Veggies
Grains
and tblSubCats would have two fields, a link to it's parent (fldCat) and the
selection item (fldFood)...
Fruits|Apples
Fruits|Oranges
Veggies|Tomatoes
Veggies|Carrots
Grains|Bread
Grains|Oats
So if you have two combo boxes, the first has a recordsource directly
related to tblCatagories.
The second one is dynamic based on the first combo... it's recordsource will
be tblSubCats, but you want to filter them based on the selected catagory.
To do this, set the AfterUpdate event of the first combo to requery the
second combo based on the selection (you'll also want this in the Current
event of the form so the selections are correct for each record you navigate
to).
Private Sub cboCatagories_AfterUpdate()
Me.cboSubCat.RowSource = _
"SELECT * FROM tblSubCats " & _
"WHERE fldCat = """ & Nz(Me.cboCat, "") & """"
End Sub
something along those lines...
hth
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)