Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked Combo Boxes

Status
Not open for further replies.
May 20, 2005
24
GB
I have two linked combo boxes in a subform. I've set the SQL correctly and put the appropriate AfterUpdate code in the first box. This all works fine when I open the subform on its own. However, when I run the parent and try and use this functionality, it brings up the "Enter Parameter Value" box when I go to pick from the second combo box!

Where am I going wrong?
 
Probably in the referencing of the first combo in the SQL for the 2nd combo.
Try to play with Me instead of the form name.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Cheers - I'm afraid I have tried that - this is the SQL that works in the subform itself,but not when it is in the parent:

SELECT Vehicle FROM Vehicles WHERE Vehicles.Make=Forms!FrmLines!Combo63.value ORDER BY [Vehicle];

I tried:
SELECT Vehicle FROM Vehicles WHERE Vehicles.Make=Me!Combo63.value ORDER BY [Vehicle]

and that doesn't work in either case
 
Provided the 2 combos are in the same form, In the AfterUpdate event procedure of Combo63:
Me![Combo??].RowSource = "SELECT Vehicle FROM Vehicles WHERE Vehicles.Make=" & Me!Combo63.Value & " ORDER BY Vehicle"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you again but I'm afraid it still doesn't work.I now get the Enter Parameters box with the selection from the first combo box as the text. I am stuck - it feels like a bug but I would expect it to be a known problem
 
And this ?
Me![Combo??].RowSource = "SELECT Vehicle FROM Vehicles WHERE Vehicles.Make=[highlight]'[/highlight]" & Me!Combo63.Value & "[highlight]'[/highlight] ORDER BY Vehicle"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top