How do you automate a report?

  • Thread starter Thread starter wisecs
  • Start date Start date
W

wisecs

Guest
I am programming a databas is MS ACCESS 2000. I need a set of reports to run automatically every morning at 7:00 am. How can I do this?
 
There are a number of ways you could tackle this:

you could have the Access application open all of the time, with an OnTimer event in a form checking the time and running the reports when the right time comes up.

But I find that having the app open all the time is a pain, so I do it like this:

Set up a separate Access database and link in any relevant tables from your main database. Also import in the relevant queries and reports.

set up an 'autoexec' macro to run the reports; the last line in the macro should be 'quit'.

You can then use Windows' task scheduler to open the new database at whatever interval you like - when it opens, the macro will run and then shut itself down.

I've also found this method useful for archival/maintenance functions. You can include a 'Sendobject' in the macro just before the 'Quit' so that it emails you on successful completion.

Hope this helps

Mike
 
interesting.

I would create a macro that opens the reports in print mode. Call it "Autoexec" so it runs on dbf opening.

Add the dbf to the startup file of the PC.

Switch the PC on at 7.00am.

Other than that you may be able to leave the PC on and create a scheduled event (simialar to a virus check)
 
Hi Mike,

When I thought about it, I could use a autoexec macro so I wrote one to open, print and quit

One problem.

The Windows scheduler will open MS Access fine.
When I ask it to open the particular file, the error log states that it cannot find the file specified.

I am using the add schedule task wizard in C:Windows\tasks

Any ideas?

Thanks
 
Yes, I had problems with this, you have to set up the task just to open Access on it's own, then go back in and edit the task afterwards and change the 'Run' parameter to something like:

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" C:\mydocu~1\mydb.mdb

which should sort it out

Hope this helps

Mike
 

Users who are viewing this thread

Back
Top Bottom