var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Passing parameters from command line to msaccess macro
My first post! Please don't kill me for asking something that is likely very obvious, but that I'm missing ...
I would like to start access from command line, running a macro when the mdb starts, and pass a parameter to that macro, straight from the command line. Something like this:
"C:\Program Files\Microsoft Office\Office11\msaccess.exe" "c:\test.mdb" /x Macro_access_start "Hello world"
The macro "Macro_access_start" would start a function using "RunCode" that would the use the parameter ("Hello world") to for instance show a msgbox or what not.
Is this possible? How do I reference the parameter from the Macro?
Create a shortcut to Test.mdb and in Tools Startup you can put a form and create a macro autoexec to do the rest.
Thanks for your reply. Unless I am mistaken, you are describing how to automatically run a macro from the command line. I know how to do that using the /x switch, which is the same, right?
However, not only do I want to run a macro automatically, I want to pass a parameter to it, straight from the command line. How do I do that?
I superceded this approach with a link to a MDE file that contains a full Menu system and dumped Macros completely however once you created your macro right click Create Short Cut.
I personally I would persevere with Macros and convet them into VB. Even if you don't know how try using existing Macros an converting them. Once you get the hang of VB you will understand why they are so much better.
I understand that VB is a much more complete language, but I don't have a license on my work machine (have done VB programming at home, so I hear you!).
Back to the question though. Is it possible to pass parameters? I can't have a gui in this application, because it has to run completely automated, hence my need to pass these parameters.
I believe so but I never tried to as this fuctionality I keep inside the application. However look at:
There are modules that perform the VB - you don't need a license but there is an extra help file that you need to load though.