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!

Subform Filters

Status
Not open for further replies.

rhoneyfi

MIS
Apr 8, 2002
200
US
I have a form that has a combo box (shows business names) and then 2 subforms ( first one shows orders received and the second one shows Awards we have given to the business) What I want to do is for a user to be able to select a business name from the combo box and then the 2 subforms just show the information for that particular business. I know it can be done...I just haven't used Access in a while. Thanks
 
Use the value selected in the drop down box as the criteria for the queries behind the subforms.

WHERE Field1 = [Forms]![frmMyForm]![Item1]
 
Thanks for the code... I am a little unfamiliar with programming...could you please clarify the coding a bit..where in the query do I put it?? Thanks
 
Anyone else have a suggestion to help me out on this small project? Thanks. I'm somewhat new to access and programming syntax
 
In your subform queries, add the code BattleDroid provided as the criteria for the BusinessNameID (or whatever you call your primary key in your business table).

Naturally you would make the following replacements when using BattleDroid's code:
Field1 = the field you want to apply the filter to in your subform
frmMyForm = the name of the main form
Item1 = the combo box in the main form that contains the filter criteria

Hope that helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top