View Full Version : Combo Box Q


mrabrams
11-02-2000, 08:03 PM
I believe I've seen this before, but cannot find it on this board.

myTable - 10 fields
field6 = category
field7 = subcategory

tblCategory - 1 field of 3 choices

tblSubcategory1 - 1 field of 4 choices
tblSubcategory2 - 1 field of 4 choices
tblSubcategory3 - 1 filed of 4 choices

On a form bound to myTable, I have a combobox1 bound to field6.
I also have a combobox2 bound to field7.

What I would like to happen, is when the user chooses a selection from combobox1 (recordsource is tblCategory)I would like combobox2 to display the corresponding choices from either subcategory1, 2 or 3.

As always, I appreciate your help and patience.

Michael Abrams

simongallop
11-03-2000, 06:07 AM
Have a look at "Loading a combo box" in Modules & VBA. Perhaps not the exact answer that you are looking for but should hopefully point you in the right direction. Any probs then post a reply

HTH

Simon

Pat Hartman
11-03-2000, 11:54 AM
The query for combobox2 needs to include a parameter where clause that refers to the value in combobox1.

Select ...
From ...
Where keyvalue = Forms!YourForm!combobox1;

Then in the AfterUpdate event of combobox1, requery combobox2.

Me.combobox2.Requery