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

Get criteria from the Form

Status
Not open for further replies.

mauricionava

Programmer
Jul 8, 2005
209
US
Hello, I created a table with all the dealers I need to run the report with. Then created a form and inserted a combo box with the dealers table and a button to run the report. How can I set my query to pull whatever dealer is selected in the combo box in the form?

I have done this before with dates and it works like this
Code:
[Forms]![MyForm].[MyField]
How would it be if I want whatever is selected in the combo box to use it as the criteria?

Thanks
 
In the on click of a button or the after update of the combo box you could try this:

DoCmd.OpenReport "YourReport", acViewPreview, "", "CriteriaField='" & YourComboBox & "'"

 
I get all reports with no data.

Is there anything to put in the query criteria?

Thanks
 
Yes whatever the field name is for the dealers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top