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 / Macros / March 2004

Tip: Looking for answers? Try searching our database.

access command line parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken - 25 Mar 2004 16:36 GMT
Hi, I need to be able to launch an Access 2000 application with command line parameters to have some startup info preselected.  According to the documentation, I should be able to include /cmd and a parameter on the command line, and then read the value using the Command function.  However, I can't get it to work.  Here are the details

I'm launching the app from Start,Run as follows: c:\temp\mydb.mdb /cmd "Ken"  (I've tried various combinations of forward slash, back slash, quotes, no quotes, etc with no effect)

Mydb.mdb has a startup form with the following code

Private Sub Form_Open(Cancel As Integer
If Command = "Ken" The
   MsgBox "got it
Els
   MsgBox "no good
End I
End Su

Ideally I would like to assign the parameter to a variable to take subsequent action, but for now I can't even get this simple exampe to work.

Appreciate any suggestions

Thanks, Ken
Bryan Reich [MSFT] - 29 Mar 2004 23:57 GMT
You are launching Access indirectly by asking the OS to load an .mdb file,
which the OS does by building it's own Access command line, but the OS only
uses the document you have provided and drops the remainder of that line.
Instead, run a command line like this:

<MSACCESS PATH>\msaccess.exe "C:\temp\mydb.mdb" /cmd "Ken"

This will ensure that the access executable is receiving the command line
exactly as you specify it, including the /cmd parameter.
Signature

Bryan Reich
Microsoft Office
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Hi, I need to be able to launch an Access 2000 application with command line parameters to have some startup info preselected.  According to the
documentation, I should be able to include /cmd and a parameter on the
command line, and then read the value using the Command function.  However,
I can't get it to work.  Here are the details:

> I'm launching the app from Start,Run as follows: c:\temp\mydb.mdb /cmd "Ken"  (I've tried various combinations of forward slash, back slash,
quotes, no quotes, etc with no effect).

> Mydb.mdb has a startup form with the following code:
>
[quoted text clipped - 11 lines]
>
> Thanks, Ken
 
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.