Windows Task Scheduler - Access not closing

hry

New member
Local time
Today, 12:00
Joined
Jul 11, 2008
Messages
2
Hi All,

I'm running a scheduled task every 5 minutes. The task opens a macro which has the following commands:
SetWarnings - Off
OpenQuery - appendqry
SetWarnings - On
Quit - SaveAll

After the task executes MS Access stays open in the task manager. Have also tried creating a function which contains the following:
Application.CloseCurrentDatabase
Application.Quit
and calling this in the macro, but still Access will not close.

Any help would be greatly appreciated.
Thanks.
Access 2002
Server Win2003 SP1
 
Its ok guys finally found it.... here is the solution:
http://www.cougardesign.ca/?p=78

The solution:
Why was there a problem? Apparently making a scheduled task run an actual macro shortcut (.MAM) file is the wrong way to do it. I’m not sure how to do it the other way using a wizard, but I’ll show you how to change the scheduled task to run the proper way.
The Wrong Way
Run:
“C:\path_to_macro\macro_name.MAM”
Start in:
“C:\path_to_macro”
The Right Way
Run:​
“C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE” “\\path\to\database.accdb” /x “Macro Name”
Start in:
“C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office”
 
Excellent, hry. And of course, the macro inside Access ends with a QUIT in order to make Access exit when the macro is done.
 

Users who are viewing this thread

Back
Top Bottom