Call Access macro from bat file - how to do with parameters?

evertVB

Registered User.
Local time
Today, 03:20
Joined
Sep 21, 2010
Messages
21
I'm calling an Access macro from a bat file using the following code:
Code:
start /wait msaccess C:\MyAccessFiles\myaccessfile.mdb /x:mymacro
The macro doesn't do anything except for running a VBA function.
Is it possible to pass on some parameters from the bat file to the macro and ultimately to the VBA function?
 
:edit:

Misread the OP.

:edit2:

Check the /cmd switch:

/cmd
Parameter: value to be returned by Application.Command function
Specifies that what follows on the command line is the value that will be returned by the Command function.
This option must be the last option on the command line.
You can use a semicolon ( ; ) as an alternative to /cmd.
Use this option to specify a command-line argument that can be used in Visual Basic code.

Goes LAST and AFTER the file path
 

Users who are viewing this thread

Back
Top Bottom