Running unattended ACCESS reports
We are running scheduled batch files for various reports at 30 min., daily, weekly and monthly intervals using this method. It may seem a bit of a kludge, but it does not require ACCESS to be running all the time, nor do you have to worry about what might start running when you manually start ACCESS. When the scheduler calls the application, it will automatically start, run and exit. If you are working with an instance of ACCESS open when the schedule kicks-off, it will just open another instance of ACCESS, then close it when it has finished. It will not interfere with what you have open other than grab some processor time and perhaps the focus.
Step 1.
Create a macro that will run your report using the actions "OutputTo" and "Quit".
When you select the OutputTo action format, file-and-path, and encoding, etc., be sure to set AutoStart to "NO"
When you select the Quit action, choose "EXIT" from its options.
Step 2.
Create a batch file (anyname.bat) with wordpad in the same directory as your database file containing the following information. Be sure that the info on the lines beginning with "path" and "start" does not word-wrap to a second line(turn off word-wrap).
c: (or drive name where your application resides)
path = %PATH%;<drive name>:\windows\command;<drive name>:\<path to your database file's location>;<drive name>:\<path to your msaccess.exe file>
start /wait msaccess.exe "<drive name>:\<path to your database file's location>\<your database file name>" /x "<name of Macro that will run your report>"
exit
Step 3.
Using whichever form of scheduler you have, set it up to call the batch file as often as needed.
You can test the batch file by clicking on it in the windows directory. The scheduler will give you an option to manually test the file as well.
WinN.