Schedule to run a Function not using AutoExec

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,
I have a scheduled task to run a particular function in my database using
the AutoExec function. But the problem with that is, as the autoexec function
runs every time some one open the database, it takes time to boot up and it
would be really helpful if I can tweak my scheduling function little bit so
that the function will run only when when the scheduler runs the task and not
every time the user opens up the database. Is there any way I can do that? I
think I have to get rid of the AutoExec function and run my scheduler in a
different way...Any ideas?

Thanks in advance for your help!
 
I do this by passing a command-line parameter from the scheduled task
to the code that runs on start-up.

From memory, add the /cmd switch to the command line, and ensure that
the command line includes the Access program as well as the MDB file.
For example:
"C:\Program Files\Microsoft Office\Office11\MSAccess.exe" "C:\My
Files\My DB.mdb" /cmd XYZ

Then in your start-up code called from AutoExec (or from Form_Open for
the form you open on start-up) you can say
If Command="XYZ" Then RunMyJob


Bill Manville
MVP - Microsoft Excel, Oxford, England
 
Back
Top