RunApp question

J

JenL

I have several databases that need to be opened, run, closed, then run the
next.

I have the following set up for the first one in a RunApp macro command:
"C:\Program Files\Microsoft Office\OFFICE11\Msaccess.exe""
S:\Mds\Data\Upload_Databases\Greece\eisrpt.mdb"/xPrivate Sub
pbContinue_Click()

The part that comes after the /x is my problem. I am not sure what to put
here. When it opens the database, I need it to basically click a button.
The code that runs when that button is clicked is "Private Sub
pbContinue_Click()". So what is the proper way to get it to "click a button"
through RunApp???

Thanks!!
 
D

Daryl S

JenL -

You have to make some changes to the application that has the button in it.
You can set the form containing that button to be the startup form, so it is
loaded when Access opens. Then you can use the Open event for that form to
look at the command line arguments you send in. If the arguments are
correct, then you can run the code behind the button and then quit out of
that database.

Look at the "Command Function" help in Access to see how to pull the values
from the command line.
 
S

Steve Schapel

Jen,

First of all, there is a problem with your expression, in that thewre are
some spaces that should be in there, and even though I haven't tested it, I
think it will make a difference.

Secondly, the /x switch refers to a *macro*, whereas you appear to be trying
to reference a VBA subprocedure.

"C:\Program Files\Microsoft Office\OFFICE11\Msaccess.exe"
"S:\Mds\Data\Upload_Databases\Greece\eisrpt.mdb" /x NameOfMacro

You will either need to wrtite a macro that does the same thing as your
pbContinue_Click() procedure, or else you will need to make a macro that
uses the RunCode action to run the pbContinue_Click() procedure, and then
call that macro in your RunApp. Without seeing what your pbContinue_Click()
does, I would probably expect the first approach to be best.
 

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

Similar Threads


Top