Schedule to run a Function not using AutoExec

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!
 
B

Bill Manville

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
 

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