Hi,
I'm having difficulty with making a cascade of more than 2 combo boxes. Let's say that my Database has a single table (let's call it TableX) containing the following columns: Category, Group, Subgroup, Information. I want to have 3 combo boxes; the first filtering the second and the second filtering the third.
The first combo box has the following rowsource:
SELECT DISTINCT TableX.Category FROM TableX;
and an after update event:
Private Sub Combo1_AfterUpdate()
Me!Combo2.Requery
End Sub
Now for the second Combobox:
SELECT DISTINCT TableX.Category, TableX.Group FROM TableX WHERE (((TableX.Category)=[Forms]![MyForm]![Combo1]));
Up to this point everything works as expected, the third combo box doesn't.
I've given it the following rowsource (also added an afterupdate event to combo2):
SELECT DISTINCT TableX.Category, TableX.Group, TableX.Subgroup
FROM TableX
WHERE (((TableX.Category)=[Forms]![MyForm]![Combo2]) AND ((TableX.Group)=[Forms]![MyForm]![Combo2]));
I don't know if I've made a mistake but the third combobox is always blank. The "AND ((TableX.Group)=[Forms]![MyForm]![Combo2]))" part seems to be the problem, because when i lebae the rowsource as:
SELECT DISTINCT TableX.Category, TableX.Group, TableX.Subgroup
FROM TableX
WHERE ((TableX.Category)=[Forms]![MyForm]![Combo2]);
the combobox works (but obviously doesn't filter how I need it to).
Any help would be greatly appreciated.