Run Macro automatically on starting Access

G

Guest

I want to run some Access-reports automatically (monthly) and I have written
a macro that calls a procedure that writes my Access reports to a file. The
macro performs beautifully when I run it manually from inside Access. But
when I try to schedule a task to do the same thing on specific dates, then it
does not work. I thought I could write /x mymacro after the name of my
database, in order to execute the macro "mymacro" when the database opens,
but the macro does not start, so I probably have missed some very basic
trick. (I am using Access 2002).
Thank you for any help!
Jannike
 
A

AlCamp

Jannike,
A Macro named Autoexec will run automatically when access is opened. (via
Scheduled Tasks) You should be able to run your reports and close the
database.
Starting the database manually by holding the Shift key while starting
will bypass the Autoexec macro.
hth
Al Camp
 
C

Chris Reveille

Jannike,

Are you using the Windows Task Scheduler? The syntax is
very important when using the Windows task scheduler. Are
you using the double quotes ""? I use Access 2000.

Syntax
"C:\Program Files\Microsoft
Office\Office\msaccess.exe" "C:\My
Documents\MyDatabase.mdb" /x "NameOfMacro"

Happy New Year

Chris
 

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