Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you pass an input parameter to Access when opening a database? 1

Status
Not open for further replies.

jeisch

MIS
May 30, 2003
23
0
0
US
I am using Access 97 and was wondering if there is a way to pass an input parameter to Access when opening up the database. I have two different sets of users that use the same application, but have certain things I would like to make available on one workstation, but not on the other. If I could just pass a one word input parameter when opening the application, this would allow me to easy control what is done in the application.

Thanks for any assistance!
 
This is how you pass command arguments to access. Create a shortcut and in the target field of the short cut type something like this:

"\\path\msaccess.exe" "\\path\YourDb.mdb" /cmd YourString

Open a form in design view and then open OnLine Help. Under the Index tab, type "command" and then select the topic "Startup command-line options". It will list all of the options available to you.
 
Thanks, That works great, and its so simple.
 
Hallo,

Do you know if you can specify a command line parameter if you don't specify the Access executable in a shortcut?
I've tried something like:
Code:
  \\path\YourDb.mdb /cmd YourString
but Command$ doesn't return YourString.

- Frink
 
Hallo,

Thanks, is there any way of specifying the Access '97 executable, which will work on machines where Access is installed in different directories?
Also if there is more than one version of access installed, and 97 may not be the default for file type .mdb?

I suspect not, but it's worth asking,

- Frink
 
Yes, you CAN do this, but I'm not sure how, sorry. I do know that it has something to do with reading the registry to find out where Access is installed on the local machine. You would launch your database using a VB Script instead of just a shortcut.

Hope that points you in the right direction.

paqguy - Shaun Beane
Instructor/Developer
sbeane@verizon.net
 
Access 97 doesn't have to be the "default" for .mdb. The shortcut will specify the version of access via its path. That is, MSAccess.exe is located in different folders for each version of Access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top