parameter value in command line switch

C

Chip

I have a database that is opened from an AS400 database using a command line.
I would like to pass the record ID the user is on into Access to open a form
on that record. Is there any way to pass that info in the command line? If
so, how do I capture that on the access side to use as a parameter?
 
A

Allen Browne

You can use the /cmd switch to pass a value, and the Command function to
retrieve it.

To auto-fire this when Access starts, use the AutoExec macro, or code in the
Open event of your startup form.
 
C

Chip

Allen,
Thank you.
I tried it, but got nothing. I added /cmd "Chip" to the command line.
In Access, I tried to set the value of a text box =command(). I opened the
immediate window and typed ?command and the answer was nothing. Am i missing
something?
 
D

Douglas J. Steele

The command line must include the full path to msaccess.exe, not just the
path to the mdb (or mde) file for the /cmd switch to work. It's a switch for
Access, not for the database.
 
C

Chip

Thank you, Doug. That did the trick.

Douglas J. Steele said:
The command line must include the full path to msaccess.exe, not just the
path to the mdb (or mde) file for the /cmd switch to work. It's a switch for
Access, not for the database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top