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

Report with parameter in query-automate with macro

Status
Not open for further replies.

vandaliarental

Technical User
Jul 17, 2000
84
US
I've designed a report to prompt the user to enter an "as of" date to search for the data. I've created a macro (to execute automatically through scheduler) to open the report, print it & close the application. I'd like to have this macro run the report as of today, without prompting the user.

Basically, I'd like to use one report for both options; automatically as of today (scheduled), or run a macro and be able to choose a date.
 
I don't believe you can do what you want by using a macro. The easiest way is to have two queries. One that prompts for a date and the other that uses the System Date ( Date() ) as the criteria for record selection. Make two copies of the report, one uses the Prompt Query and the other uses the system date query. Then call the correct report as the situation fits.

With VBA you could have one report and modify the Record Source property of the report. Changing between the two queries described above whichever situation is appropriate.

Hope this helps.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top