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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting items in a Combo Box with a Query 1

Status
Not open for further replies.

LRguy

Technical User
Nov 26, 2003
7
CA
I have a customers table and a recipes table. With this I control which customers use certain recipes. I want to create a combo box in a subform as line items within an "Orders" form. The form and sub-form work great except the combo box shows all recipes, not just the customer recipes, determined by the Customer_ID in the main form.
 
Open the form and go to a customer. Write a query which finds the recipes for that customer using a criteria like this on the Customer_ID:

Forms!CustomerForm.Customer_ID

Verify that it works and then use this as the source for the combo box in the sub form. You'll have to Refresh the combo box as needed, probably using the OnCurrent event for the main form (refreshes each time the customer changes even if they don't touch the combo box) or the OnEnter event for the sub form (only refreshes when they go into the sub form). Play around with it to see what works best for the type of navigation going on. There may be a better event to use than these.
 
Thanks very much JonFer I'll give this a try and let you know..cheers
 
It worked great JonFer

Thanks Very much

LR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top