Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Access Macro from Windows XP Scheduler 6

Status
Not open for further replies.

ThinWhiteDude

Technical User
Sep 21, 2004
97
US
Hi to all,

Using Access 2003. . .

I have been having some trouble running an Access macro directly from Windows XP Scheduled Tasks. Here's my command line:

"C:\Documents and Settings\mp.Company\My Documents\Cust\EPA DB\Inspections_Add-On\Cust_DB_5-3-07.mdb" \x mcrOverdueHazWasteInspectNotification

I know I must have something in the switch wrong, but am not familiar enough with this to pinpoint it. I might add, that I can get the DB to open but the macro doesn't run, so the process works up to a certain point.

Any help you can give will be greatly appreciated.

TWD
 
I'm not familiar with the x switch but command line switches use the foward slash and not the backslash. So change \x to /x...

"C:\Documents and Settings\mp.Company\My Documents\Cust\EPA DB\Inspections_Add-On\Cust_DB_5-3-07.mdb" /x mcrOverdueHazWasteInspectNotification


Assuming x runs a macro, you should be set.
 
[!]"\path\to\msaccess.exe" [/!]"C:\Documents and Settings\mp.Company\My Documents\Cust\EPA DB\Inspections_Add-On\Cust_DB_5-3-07.mdb" [!]/[/!]x mcrOverdueHazWasteInspectNotification

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV, what an embarrassing oversight for me. [blush]
 
PHV --Thanks once again for your help, the syntax correction (plus specifying the program path) were just what I needed.

Couldn't test until today --running fine.

TWD
 
Hello,
I am having the same issue but from what I can see mine is correct. I'm using a batch file (.bat)

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
"C:\Documents and Settings\Angel\Angel'sWindows\Schools\CCS\Schedules\Schedule.mdb" /x mcrtest


what happens:
i see the command prompt go off
then MS Access opens

i have to X out of it and then I see the command prompt with the second line (actual command i need executed)

then the Schedule.mdb opens BUT the macro does not actually run.

What do i have wrong?
 
What do i have wrong
The whole command should be on a single line in the .bat.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,
well, i have changed it to a single line:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE""C:\Documents and Settings\Angel\Angel'sWindows\Schools\CCS\Schedules\Schedule.mdb" /x mcrtest


now, i kind of see it run but not like before and it still did not run :-(
 
It looks like you are missing a space between the executable and the database file...

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\Documents and Settings\Angel\Angel'sWindows\Schools\CCS\Schedules\Schedule.mdb" /x mcrtest
 
LOL!
gotta be kidding ... well, that was it!


thank you very very much!

I swore I tried every little variation
 
Thanks so much guys I benefited from this posting too.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top