B
benjaminkmartin
I have two comboboxes where combo1 follows combo2. I want the coice
in combo1 to reduce the choices in combo2.
Choices in combo1 are Vehicle A and Vehicle B. Each is given an ID of
1 for Vehicle A and a 2 for Vehicle B
The table for combo2 has several different locations, which are
different for each vehicle. The table looks as follows.
Table1:
Vehicle_ID, Location, Location ID
1 LocA 01
1 LocB 02
2 LocA 01
2 LocC 03
2 LocD 04
As shown, some of the locations occur on both vehicles... Right now
combo2 has all the locations listed, but I only want the ones on that
particular vehicle to show up. How do I do that?
I found a code to be place in afterupdate of combo1 for a similar
question, but I couldn't get it to work for me.
(air code)
dim strSQL as string
strSQL = "Select whatever WHERE CompanyID = " & me!combo1
me!combo2.rowsource=strSQL
Thanks for the help, I really need it!
in combo1 to reduce the choices in combo2.
Choices in combo1 are Vehicle A and Vehicle B. Each is given an ID of
1 for Vehicle A and a 2 for Vehicle B
The table for combo2 has several different locations, which are
different for each vehicle. The table looks as follows.
Table1:
Vehicle_ID, Location, Location ID
1 LocA 01
1 LocB 02
2 LocA 01
2 LocC 03
2 LocD 04
As shown, some of the locations occur on both vehicles... Right now
combo2 has all the locations listed, but I only want the ones on that
particular vehicle to show up. How do I do that?
I found a code to be place in afterupdate of combo1 for a similar
question, but I couldn't get it to work for me.
(air code)
dim strSQL as string
strSQL = "Select whatever WHERE CompanyID = " & me!combo1
me!combo2.rowsource=strSQL
Thanks for the help, I really need it!