Rick Brandt wrote:
ms*****@gmail.com wrote:
>>Is there a way to set up access to open and run a query in a
particular database at a particular time each day? This would be run
from a Windows 2000 desktop.
You can either...
Use the Load or Open event of a form set to be displayed at startup to run the
query and then close the file.
...or...
Use a macro named AutoExec that will also run automatically when the file is
opened.
...or...
Use the /Macro command line argument to open the file which allows you to
specify a macro that will automatically run when the file is opened.
You then use Windows Scheduled Tasks to actually launch the file according to
the desired schedule. In a corporate network environment Scheduled Tasks
normally run under the System account and that account might not have adequate
permissions to make the file work properly. In that case you have to configure
the task to run under your account and supply a password.
I sucessfully use the third method Rick suggest; however, I seem to recall it works using
the /x parameter to call a named macro (instead of /Macro) but that may be a version issue
(I'm using A2K).
so
"c:\Program Files\Microsoft Office\Office\msaccess.exe" /x myMacro
starts my Access installation and runs the "myMacro" macro on startup. That macro opens a
report, prints it and exits Access. Been running for years with no problem.
And Rick's comments on the System account are important. I schedule a report to be printed
each morning before personnel arrive for work. But, to print in a networked environment
requires an account with more privilege than "System". But XP lets you scheduled tasks to
run as any user where you can supply a valid password (one that can access a printer in my
case).
If you think about it a bit you wouldn't want just any user to schedule a task that
(basically) runs with Admin privileges (as early Win-95, Win98 everyone-runs-as-root OSs
did) but instead control access to this important activity.
Good luck...
--
'---------------
'John Mishefske
'---------------