Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Passing a command line argument into Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
richardb - 30 Dec 2005 18:27 GMT
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
Kevin K. Sullivan - 30 Dec 2005 19:46 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.