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

Limiting SubForm Values based on Main Form Combo Boxes

Status
Not open for further replies.
May 21, 2003
64
US
I have a database that contains company & product information. The database contains a form where users select Name/Date/Location/Company/and Product line. The subform allows them to select the item # of the specific product in another combo box and autopopulates the description. Currently, the subform shows all 4k lines of products. I would like to limit the products based on the company and product line the user chooses. I have the subform combo box based on a query. I clicked on it and added company and product line, but I don't know how to link that to the value stored in the combo box of the parent form. If I create parameters [enter company name] it works fine, but I would like to reference the info they already entered. Is there a way to reference combobox form elements in a query or am I going about this wrong? Thanks.
 
Instead of [enter company name] use [Forms]![name of mainform]![name of combo]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This solution works, but when I move to the next record, and change the company and/or productline, the options are limited based on the initial combo box selections. If I create a button that triggers a macro that closes and then opens the form again it fixes the problem, but is there another way to reset the query when I move to the next record? Thanks.
 
Have a look at the Requery method.

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