Connect with Expertise | Find Experts, Get Answers, Share Insights

Running macro as a Scheduled Task

E Harris
 
Posts: n/a
#1: Nov 12 '05
Hello all.

I want to schedule an Access macro to run. The macro runs 3
make-table queries.

The best way I thought to accomplish this is to create a shortcut, and
then use the task scheduler to run that shortcut.

I am working within a secure workgroup. Here is what my shortcut
contains:

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
"C:\PathToDatabase\database.mdb" /user "myUsername" /pwd "myPassword"
/x "MakeListboxTables"

Manually running this shortcut works fine, except for one thing--
since make-table queries are what the macro runs, a total of 6 dialog
boxes pop up, 2 for each make-table query. The first asks me to
confirm that I want to run a make-table query. Once the query runs, a
second dialog box ask me to confirm that I want to insert X rows of
data into the new table.

Of course, sitting at my computer, I can click "Yes" 6 times and
accomplish the task. My question is.... how can I skip the dialog
boxes so that I can automate this task with the task scheduler? Is
there another /switch I can use on the command-line (that is, my
shortcut) that will bypass these dialog boxes?

I'm so close to making this work! Please, any help is greatly
appreciated.

Thanks so much!

Lynn Trapp
 
Posts: n/a
#2: Nov 12 '05

re: Running macro as a Scheduled Task


Set the First line of your macro to be SetWarnings = No and the Last line to
be SetWarnings = Yes.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"E Harris" <redunzl3@hotmail.com> wrote in message
news:150316e.0405250943.7ab9f6b6@posting.google.co m...[color=blue]
> Hello all.
>
> I want to schedule an Access macro to run. The macro runs 3
> make-table queries.
>
> The best way I thought to accomplish this is to create a shortcut, and
> then use the task scheduler to run that shortcut.
>
> I am working within a secure workgroup. Here is what my shortcut
> contains:
>
> "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
> "C:\PathToDatabase\database.mdb" /user "myUsername" /pwd "myPassword"
> /x "MakeListboxTables"
>
> Manually running this shortcut works fine, except for one thing--
> since make-table queries are what the macro runs, a total of 6 dialog
> boxes pop up, 2 for each make-table query. The first asks me to
> confirm that I want to run a make-table query. Once the query runs, a
> second dialog box ask me to confirm that I want to insert X rows of
> data into the new table.
>
> Of course, sitting at my computer, I can click "Yes" 6 times and
> accomplish the task. My question is.... how can I skip the dialog
> boxes so that I can automate this task with the task scheduler? Is
> there another /switch I can use on the command-line (that is, my
> shortcut) that will bypass these dialog boxes?
>
> I'm so close to making this work! Please, any help is greatly
> appreciated.
>
> Thanks so much![/color]


Steve Schapel
 
Posts: n/a
#3: Nov 12 '05

re: Running macro as a Scheduled Task


E Harris,

Put a SetWarnings,No action in your macro, prior to your first RunSQL or
OpenQuery action.

--
Steve Schapel, Microsoft Access MVP


E Harris wrote:[color=blue]
> Hello all.
>
> I want to schedule an Access macro to run. The macro runs 3
> make-table queries.
>
> The best way I thought to accomplish this is to create a shortcut, and
> then use the task scheduler to run that shortcut.
>
> I am working within a secure workgroup. Here is what my shortcut
> contains:
>
> "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
> "C:\PathToDatabase\database.mdb" /user "myUsername" /pwd "myPassword"
> /x "MakeListboxTables"
>
> Manually running this shortcut works fine, except for one thing--
> since make-table queries are what the macro runs, a total of 6 dialog
> boxes pop up, 2 for each make-table query. The first asks me to
> confirm that I want to run a make-table query. Once the query runs, a
> second dialog box ask me to confirm that I want to insert X rows of
> data into the new table.
>
> Of course, sitting at my computer, I can click "Yes" 6 times and
> accomplish the task. My question is.... how can I skip the dialog
> boxes so that I can automate this task with the task scheduler? Is
> there another /switch I can use on the command-line (that is, my
> shortcut) that will bypass these dialog boxes?
>
> I'm so close to making this work! Please, any help is greatly
> appreciated.
>
> Thanks so much![/color]
Closed Thread