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

Avoiding Multiple prompts when running a report

Status
Not open for further replies.

aaronmc52

MIS
May 6, 2003
11
US
Hola!
I have a report that is based on a query. This querty searches for a match in a certain field. In the query I have entered [Enter Facility ID] to get it to return the results for the certain Facility ID that the user entered. When I run the report it prompts me twice for that field. And at the end of the report in the footer I have a chart that is based on another query. This query also has the prompt [Enter Facility ID] in it. Currently when I run the report I get the Enter Facility ID prompt three times. I was wondering if there was a way to get this prompt to only come up once so that when running the report the user will only enter the Facility ID once, since it will be the same answer for that report. Does anyone have any suggestions?
 
Probably easiest thing is to open a form and have the user enter the data on a control. Have the control launch the report on after update, and have the query refer to that control.

ChaZ

Ascii dumb question, get a dumb Ansi
 
Create a form where you will enter your query criteria, and have your queries look at the value entered on the form.
After entering the value on the form, include a button to launch your report(s).
For your example, you are entering a Facility ID.
Create a field on your form called facilty ID. Do not bind it to the Facility ID in your table. Now, in your queries, in the criteria section under the Facility ID field, include something like this:

Assuming your form name is Form1 and the field name is FaciltyID.

So, in the criteria field enter this:

[Forms]![Form1]![FacilityID].value

Make sure to use the applicable form name and field name.

Make sure to leave the form open while the queries run, otherwise, the query will go searching for a parameter that's not there(available).

Hope this helps you.
 
This works beautifully! How do I get the command button that calls the report on this form to close the form once the report has ran? Thanks.
 
Nevermind I just figured it out. Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top