Sign in to follow this  
Followers 0
dmorand

Script to run access reports

3 posts in this topic

I've written a script to call an access macro which runs a report and automatically prints the report to various printers. I'm having trouble determining when I need to have access exit. I need to quit access once it's done printing the report, but I don't know how to determine that it's happened so I end up closing access too early.

Here is a snippet of my code:

Run(@ProgramFilesDir & "\Microsoft Office\OFFICE11\msaccess.exe " & $database & " /x " & $macro)
;Make sure that the database window is active, otherwise wait for it to be active
WinWaitActive("Siemens Medication Administration Check Reports 23.4-3")

Share this post


Link to post
Share on other sites



I've written a script to call an access macro which runs a report and automatically prints the report to various printers. I'm having trouble determining when I need to have access exit. I need to quit access once it's done printing the report, but I don't know how to determine that it's happened so I end up closing access too early.

Here is a snippet of my code:

Run(@ProgramFilesDir & "\Microsoft Office\OFFICE11\msaccess.exe " & $database & " /x " & $macro)
;Make sure that the database window is active, otherwise wait for it to be active
WinWaitActive("Siemens Medication Administration Check Reports 23.4-3")
are the printers located on the same computer? if so wait for the tray icon of the printer to go away. you can get the handle of it I think.

Share this post


Link to post
Share on other sites

I have the printers setup on my computer. I'll give that a shot and update with how that works. Thanks!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0