I'm having trouble getting cascading combo boxes to work. I think it is due to the table set up. I'm sure it could be consolidated a bit, but I'm unsure of how to go about doing that. Here's the set-up:
tblCategories: Column 1 is the ID, and column 2 is the 9 Categories to chose from.
tblFields: Column 1 is an ID, column 2 is the Categories which link up to column 3 which is the fields.
I did it like this because I don't know another way to make the categories line up correctly to the fields, while also only giving the 9 options to choose from in the categories box.
cmbCat: Lists the 9 categories (correclty thus far). After Update code as follows.
Code:
Private Sub cmbCat_AfterUpdate ()
Me.cmbFields.RowSource = "SELECT Fields FROM" & " tblFields WHERE Category = " Me.cmbCat"
me.cmbFields = Me.cmbFields.Itemdata(0)
End Sub
cmbFields: is supposed to take the 57 fields and narrow by categories (obviously). Displays nothing.
When I make a selection in cmbCat, I get a Compile error: syntax error message and enter the debugger. The RowSource line is highlighted in all red with no indiciation of specifically which part is incorrect.
I know I am pretty far off base here. But, even after reading through forum posts here, watching the datapig videos, using the microsoft help pages, and searching other forums I can't figure out where exactly this is going wrong.