AUTOMATING COMMAND USING A MACRO?

L

Liam.M

hey guys,

if someone could please provide me with some assistance it would be
very much appreciated...my problem is as follows:

I have just downloaded a Scheduling utility to Run my database on a
certain time....I need to create a macro to execute a particular
command I have written titled "SBMACheckAndEmail_Click()"...currently
this Code/ Command is used as an "On Click" Event proceedure for a
button I have created....how can I automate this through the use of
Macro...and how would I go about this?


Kind Regards,

Liam.
 
S

Steve Schapel

Liam,

You can use a /x command line switch to run an Access macro. So in your
scheduling utility, a command line like this will probably be supported...
"C:\PathToAccess\Msaccess.exe" "C:\PathToDb\YourDb.mdb" /x NameOfMacro

So, one choice is to re-write your VBA procedure as a macro, and then
run the macro via the above method.

Another choice is to copy the VBA procedure into a standard module, and
re-define it as a Function. You can then make a macro with the RunCode
action, to call this function, and this RunCode macro run via the
command line as above.

Hope that might point you in the right direction.
 

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