Auto Run a Report

S

Sean

If I have a report that is based off a query, how do I get that report to run
automatically every hour and print if there were any results? Does any one
have a code example I could use?
Thanks,
Sean
 
C

Chris Reveille

One way is to use thw Windows Task Scheduler or a similar product.

Create a new db and import reports/queries needed for the report and link
tables
create a macro and name it autoexec
in the conditions column put
DCount("[somefieldinquery]", "reportqueryname")>0
In the actions put
open report

In the Windows Task scheduler, schedule yor report to run every hour
Your run command would look somthing like this. watch for word wrap

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
C:\yourdfolder\accessdbname.mdb

If you are useing Office 2000 change OFFICE11 to OFFICE
 
K

Klatuu

Create a form with a timer event that fires each hour and runs the report
wihen the timer fires. It can be hidden. Or, if you already have a hidden
form running in your application and it has a timer event for other
activities, each time the timer fires, see if it is on the hour (8:00, 9:00,
etc) or whatever minute you want to print the report on and test it like this:

If DatePart("n", Time) = 0 Then
'Run the report
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top