I am trying to create a cascading combo boxes to filter data. The data is being filtered by 2 or 3 levels of filtering. I have setup the combo boxes as per the screen shot.
When the first category is selected from level 1, the level 2 combo appears and lists the options available in level 2 based on the level 1 selection. This also works for level 3.
My fist issue is that there is not always a level 3 option. How would I add an IF statement to count the number of items for the combo and only show the combo if it is not null. I am controlling the combo boxes by the following code.
Private Sub cboLevel1_AfterUpdate()
Me.cboLevel2.RowSource = "SELECT L2ID, Description FROM CCatStructL2 WHERE L1ID = " & Me.cboLevel1
Me.cboLevel2.Visible = True
Private Sub cboLevel2_AfterUpdate()
Me.cboLevel3.RowSource = "SELECT L3ID, Description FROM CCatStructL3 WHERE L2ID = " & Me.cboLevel2
Me.cboLevel3.Visible = True
After completing that task, I would like to have the selections from either 2 or 3 levels display the items in the catelogue.
I hope I have explained my problem clear enough.