Run Macro automatically on starting Access

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top