Way to start Access macro

  • Thread starter Andre Laplume via AccessMonster.com
  • Start date
A

Andre Laplume via AccessMonster.com

I seem to remember being able to somehow schedule a db to open and fire off a
macro. I remember (at Ieast think I do) doing this from the START RUN
window, or in the task scheduler. The command was something like this:


"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\MyDBS\MyDB.mdb" /excl /x mcrMyMacro"


Anyone remember how to do this? When I do this in the task schedule it opens
the db but does not start the macro....

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))
 
K

Ken Snell [MVP]

Is what you posted the exact string you're using? You have an extraneous "
character at the very end:

"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\MyDBS\MyDB.mdb" /excl /x mcrMyMacro


--

Ken Snell
<MS ACCESS MVP>

Andre Laplume via AccessMonster.com said:
I seem to remember being able to somehow schedule a db to open and fire off
a
macro. I remember (at Ieast think I do) doing this from the START RUN
window, or in the task scheduler. The command was something like this:


"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\MyDBS\MyDB.mdb" /excl /x mcrMyMacro"


Anyone remember how to do this? When I do this in the task schedule it
opens
the db but does not start the macro....

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And
Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))
 
A

Andre Laplume via AccessMonster.com

Sorry Ken, was out Monday. I do not have the extra quote in there in reality.
Someone told me the task scheduler (specifically where I would paste this run
command) may only recognize so many (12?) characters and my run command may
be too long...I have not had a chance to try to shorten it yet.
Is what you posted the exact string you're using? You have an extraneous "
character at the very end:

"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\MyDBS\MyDB.mdb" /excl /x mcrMyMacro
I seem to remember being able to somehow schedule a db to open and fire off
a
[quoted text clipped - 11 lines]

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
K

Ken Snell [MVP]

The scheduler will accept longer names than this...

Did you use the wizard to set up the scheduled task?

--

Ken Snell
<MS ACCESS MVP>

Andre Laplume via AccessMonster.com said:
Sorry Ken, was out Monday. I do not have the extra quote in there in
reality.
Someone told me the task scheduler (specifically where I would paste this
run
command) may only recognize so many (12?) characters and my run command
may
be too long...I have not had a chance to try to shorten it yet.
Is what you posted the exact string you're using? You have an extraneous "
character at the very end:

"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\MyDBS\MyDB.mdb" /excl /x mcrMyMacro
I seem to remember being able to somehow schedule a db to open and fire
off
a
[quoted text clipped - 11 lines]

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And
Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
A

Andre Laplume via AccessMonster.com

The wizard lets me pick the MsAccess app but then I am unsure where to put
the rest of it. I just tried the following:

In the 'Start In' box I pasted:

"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"


in the 'Run' box I pasted:

"G:\folder1\folder2\folder3\DataBases\MyDB.mdb" /excl /x mcrMyMacro

It prompted me for my pw then let me save the scheduled task.

I clicked: Run and it fired up the appropriate Access db but did not execute
the macro. Perhaps my syntax is off? Note the actual path on the G drive is
quite a bit longer than that shown, thus the thought that perhaps there was a
string size limitation.






P] said:
The scheduler will accept longer names than this...

Did you use the wizard to set up the scheduled task?
Sorry Ken, was out Monday. I do not have the extra quote in there in
reality.
[quoted text clipped - 16 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
K

Ken Snell [MVP]

Do you have a password on the ACCESS database file?

--

Ken Snell
<MS ACCESS MVP>

Andre Laplume via AccessMonster.com said:
The wizard lets me pick the MsAccess app but then I am unsure where to put
the rest of it. I just tried the following:

In the 'Start In' box I pasted:

"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"


in the 'Run' box I pasted:

"G:\folder1\folder2\folder3\DataBases\MyDB.mdb" /excl /x mcrMyMacro

It prompted me for my pw then let me save the scheduled task.

I clicked: Run and it fired up the appropriate Access db but did not
execute
the macro. Perhaps my syntax is off? Note the actual path on the G drive
is
quite a bit longer than that shown, thus the thought that perhaps there
was a
string size limitation.






P] said:
The scheduler will accept longer names than this...

Did you use the wizard to set up the scheduled task?
Sorry Ken, was out Monday. I do not have the extra quote in there in
reality.
[quoted text clipped - 16 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And
Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
A

Andre Laplume via AccessMonster.com

I have tried it with and without. The db itself is not pw protected.
Ken said:
Do you have a password on the ACCESS database file?
The wizard lets me pick the MsAccess app but then I am unsure where to put
the rest of it. I just tried the following:
[quoted text clipped - 29 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
K

Ken Snell [MVP]

I've reread your post thread... are you creating a shortcut or are you
creating a scheduled task?

--

Ken Snell
<MS ACCESS MVP>

Andre Laplume via AccessMonster.com said:
I have tried it with and without. The db itself is not pw protected.
Ken said:
Do you have a password on the ACCESS database file?
The wizard lets me pick the MsAccess app but then I am unsure where to
put
the rest of it. I just tried the following:
[quoted text clipped - 29 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And
Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
A

Andre Laplume via AccessMonster.com

I am attempting to created a scheduled task. There is a 'Run' and 'Start
In' box that must be filled in for the scheduled task. That is where I paste
the code above.....it opens the db but never executes the macro....perhaps my
syntax for executing the macro (following the code to open the db) is wrong...
?
I've reread your post thread... are you creating a shortcut or are you
creating a scheduled task?
I have tried it with and without. The db itself is not pw protected.
[quoted text clipped - 7 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
K

Ken Snell [MVP]

The "Run:" box should contain the entire expression that you've posted (all
one line, not a wrapped line as presented in the newsreader):
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\folder1\folder2\folder3\DataBases\MyDB.mdb" /excl /x mcrMyMacro

The "Start In:" box should contain this expression:
"G:\folder1\folder2\folder3\DataBases\"

--

Ken Snell
<MS ACCESS MVP>


Andre Laplume via AccessMonster.com said:
I am attempting to created a scheduled task. There is a 'Run' and 'Start
In' box that must be filled in for the scheduled task. That is where I
paste
the code above.....it opens the db but never executes the macro....perhaps
my
syntax for executing the macro (following the code to open the db) is
wrong...
?
I've reread your post thread... are you creating a shortcut or are you
creating a scheduled task?
I have tried it with and without. The db itself is not pw protected.
Do you have a password on the ACCESS database file?
[quoted text clipped - 7 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And
Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 
A

Andre Laplume via AccessMonster.com

It Worked! It was either an extraneous character or not having the write
string in the 'Start In' box or both. Thanks Again!
The "Run:" box should contain the entire expression that you've posted (all
one line, not a wrapped line as presented in the newsreader):
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"
"G:\folder1\folder2\folder3\DataBases\MyDB.mdb" /excl /x mcrMyMacro

The "Start In:" box should contain this expression:
"G:\folder1\folder2\folder3\DataBases\"
I am attempting to created a scheduled task. There is a 'Run' and 'Start
In' box that must be filled in for the scheduled task. That is where I
[quoted text clipped - 15 lines]
[Amt]*[Percent],0)))

--
OOPs a typo...the statement that DOES NOT work is:

AdjAmt: Sum(IIf([TYPE]=2 And Left(Date(),2)="07",[Amt]*[Percent],IIf([TYPE]=1,
[Amt]*[Percent],0)))


Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top