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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell Command 1

Status
Not open for further replies.

lasitha

Programmer
Jun 7, 2003
38
LK
Hi,

I have Ms Access file. I want to use vb form (vb project) to open that access file.

Q1. How could I pass a string value from vb form to Ms access application's start up form. Because no one can open access application without running vb application.

Q2. Is it possible to use "Shell" command to open Ms Access application through vb application.

Q3. How to pass value from vb application through "Shell Command" to Ms Access file's statr-up form.



ThankX in Ad.
Lasitha Alawatta.
 
Hallo,

If you look up Command Line in Access Help it should give you an idea of what parameters you can pass to Access, in a shortcut. /cmd is used to pass user-defined parameters

Inside Access the Command line parameters are returned by the Command$ function.

ie. The command:
Shell "C:\Program Files\Microsoft Office\Office\msaccess.exe" "D:\MyDB\MyDB.mdb" /cmd MyStartup
Will open your MyDB database and the Command$() function within MyDB will return "MyStartup"

In my experience,
Shell "D:\MyDB\MyDB.mdb" /cmd MyStartup
didn't work. Command$ returned Null, so the application has to be specified. This was in Access 97 and 2000 on NT, so it might be ok for other applications or operating systems.

- Frink
 
Frink, you right. The reason your first shell statement worked was because you're specifically launching msaccess.exe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top