Scheduled execution

mlcktmguy
mlcktmguy used Ask the Experts™
on
I remember reading that it was possible to initiate Access from a batch file using startup parameters but I really don't know anything else about it.

I have a production MDE that is used by the client every day.  It is set up with an autoexec macro that performs some housekeeping and then opens the main screen/ menu of the application.  

When I setup my scheduled process I would probably want the MDE to open and automatically run a certain function rather than the 'autoexec' macro.   Is it possible to override the execution of the autoexec?

I have a process that I would like to schedule to run every evening on my client server.  They would set up the task on a scheduler and suggested that I set up a batch file to initiate the process.

What would the line that initiates Access from the batch file look like?

Any help would be appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
Commented:
Access provides a number of start up options.  they are called "command line switches".  One of them lets you specify a specific macro to run.  This is the help entry.

http://support.microsoft.com/kb/209207/en-us
Most Valuable Expert 2012
Top Expert 2014
Commented:
If I'm not mistaken, the AutoExec macro always runs, even if you've specified another macro to run via the command line. Be sure to test this before implementing.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
The others have already pointed you in the right direction,  but if you've got a bit of time to kill, you might also want to take a look at:

http://www.experts-exchange.com/VP_73.html

 I cover all the different ways of starting Access from the command line and passing parameters in different ways.   The webinar covers a lot of other top Access questions as well.

 The command line stuff starts at 24:00 minutes in.

Jim.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
BTW, if you watch that section closely, you might catch the one mistake I made in that presentation; when I was trying to show the short cut properties in talking about /CMD, I did an edit instead<g>  

Served me right for trying to bounce back and forth between the script and what I was doing on screen.

Jim.
Distinguished Expert 2017

Commented:
@Scott,
Using the /x option to open Access to run a macro bypasses the AutoExec macro.

Author

Commented:
I have been doing some testing in Access 2003 today based on the responses above.

In my testing with the /X option, it does not suppress the autoexec from running.  

The Autoexec runs, then my specified macro runs.
Most Valuable Expert 2012
Top Expert 2014

Commented:
@Pat,
No it doesn't. I just tested it. The macro indicated by the command line does run, but the AutoExec macro runs also.
Distinguished Expert 2017

Commented:
@Scott,
That's scary.  What version are you using?  I'll check A2010 when I get home.

Author

Commented:
Excellent, thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial