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

ENTER criteria (in query) when running a report 1

Status
Not open for further replies.

chris3942

Technical User
Jul 2, 2003
17
US
I run reports based on a table. I use a query to present the appropriate data when the user chooses to run the report. The report has a column titled "Manufacturer" which corresponds to a column in the table the report data is based on. In the query the criteria for the Manufacturer column contains: [Enter Manufacturer]. When the user runs the report a window prompts the user to enter the "Manufacturer". I would like to present a list to user to to allow him/her to select the appropriate "Manufacturer" to satisfy the query.
 
chris3942
Create a form with either a list box or a combo box that shows your Manufacturers. Then have a command button to run the report.

In your query that populates the report, in the Manufacturers column, put the following criteria
Forms!YourInputFormName!ListBoxName.Column(x)

(another method would be to remove the criteria from the query column and include a Where condition in the code that calls for the report to be printed. Something like...
DoCmd.OpenReport "YourReport, acViewNormal,,WHERE condition)

I don't know enough about your table setup to indicate what the Where condition might be.

Hope this helps.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top