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

Report from query-form with dropdown box of choices 1

Status
Not open for further replies.

SNicholls

Technical User
May 13, 2004
22
US
In Access 2003, I usually provide a “query” button that is actually creating a report based on a query. But I wanted to offer choices on which to base the query. I created a very simple form:

-a label that says “click below for search choices:”
-followed by a combo box with a dropdown list based on a lookup table,
-followed by a command button that invokes the query.
(Query criteria: Forms!frmQueryTypeProjectDrop!cmboTypeProject)

The result is the standard table but I want a Report, rather than a table, in one click; how can I let the user click one button, offer a dropdown box of choices to query, and provide the result in a report (instead of a table)?
 
You can create the report based on the query. Then behind the button that opens the query, you can say:

DoCmd.OpenReport "YourReportName", acViewPreview

-Gary
 
That works with a standard query but with the form-query, it doesn't give the dropdown box choices.
 
What doesn't give the dropdown box choices? I thought that the combo box was on the form.

The user opens a form, frmQueryTypeProjectDrop, which has a combo box on it, cmboTypeProject. Then you have a query that selects records based on the value in the combo box, and a report based on the query. Is this correct?

If so then the only line you should need behind the button to display the report is the OpenReport method.

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top