Found post 8/20/2005 from ofer and tried his solution. Also consulted on-line
docs, but still having no success passing a command line argument. Latest try
was this in a shortcut:
"G:\Access Projects\Scanning\Scanning.mdb" /cmdHOME OFFICE
Then I created a button on a form with click event:
Dim LocationID As String 'Also tried leaving it as a variant.
LocationID = Command()
MsgBox "LocationID is " & LocationID
Keeps coming up blank and I can't figure out what is wrong. Have tried
different uses of quotes in the short cut, but no luck. Help appreciated.
richard
If you want Access to read the command line, you *must* reference
msaccess.exe. The command line arguments are ignored if your shortcut
is just to the .mdb file. I've been there - it's very frustrating.
Try the format:
PathToAccessApp MDBfile /cmd ArgumentToPassIn
put each piece that may have spaces between double quotes:
"C:\Program Files\Microsoft Office\msaccess.exe" "G:\Access
Projects\Scanning\Scanning.mdb" /cmd "HOME OFFICE"
> Found post 8/20/2005 from ofer and tried his solution. Also consulted on-line
> docs, but still having no success passing a command line argument. Latest try
[quoted text clipped - 13 lines]
>
> richard
richardb - 30 Dec 2005 20:37 GMT
Thanks Kevin, I wouldn't have guessed. My problem now is to find
msaccess.exe. It is not in the C:\Program Files\Microsoft Office folder or
any sub folder so far as I could find. Any thoughts?
> If you want Access to read the command line, you *must* reference
> msaccess.exe. The command line arguments are ignored if your shortcut
[quoted text clipped - 26 lines]
> >
> > richard
Rick Brandt - 30 Dec 2005 20:41 GMT
> Thanks Kevin, I wouldn't have guessed. My problem now is to find
> msaccess.exe. It is not in the C:\Program Files\Microsoft Office
> folder or any sub folder so far as I could find. Any thoughts?
Usually it's at...
C:\Program Files\Microsoft Office\Office\MSAccess.exe

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
richardb - 30 Dec 2005 20:43 GMT
It was in Office11. Please ignore last post.
> If you want Access to read the command line, you *must* reference
> msaccess.exe. The command line arguments are ignored if your shortcut
[quoted text clipped - 26 lines]
> >
> > richard