/cmd parameter not being passed to program.

T

ThomasAJ

The shortcut target is:
"path mydb.mdb" /cmd "abc"

The function Command returns nothing regardless of where I use it. By 'where
I use it" I mean that I have tried it in many places just in case it has a
'lifespan' or is 'unuseable' in certain parts of the code if you know what I
mean.

I want to use it in a function called AutoExec which is run from macro
AutoExec (a common situation).

I resorted to using:
MsgBox Command
in various locations to see the contents of Command but they were empty.

If I enter "abc" in Tools/Options/Advanced/Command-line arguments and RUN
macro Autoexec then Command does return 'abc'.

I have triple checked the spaces etc. in
"path mydb.mdb" /cmd "abc"

What the heck is going on?

PS I have run "path mydb.mdb" /cmd "abc" from Start/Run without success.

Running Access 2003 on WinXP Pro.
 
R

Rick Brandt

ThomasAJ said:
The shortcut target is:
"path mydb.mdb" /cmd "abc"

Command line arguments only work when the command is pointing to the Access
executable. It can't just point at an MDB file.

Example:

"C:\Program Files\Microsoft Office\Office\MsAccess.exe" /cmd abc "path to
mydb.mdb"
 
V

Van T. Dinh

You need to use the fullpath to MSAccess.exe like:

"FullPathToMSAccess.exe" "FullPathToMDB_MDE" /cmd ...

/cmd switch must be the last option specified if you use more than 1 option.

Check Access Help topic "Startup Command-Line Options".
 

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