Command line help

J

JOE

Does anyone know the command line syntax to open a form in
an Access DB?

Thanks,
Joe
 
C

Céline Brien

Hi Joe,
How about this ?
stDocName = "Name of Form"
DoCmd.OpenForm stDocName
Céline
 
M

Marshall Barton

JOE said:
Does anyone know the command line syntax to open a form in
an Access DB?


Normally you would specify the form as the Startup Form
(Tools - Startup).

If you want to be able to open different forms from the
command line, you'll have to create a macro for each form.
Each macro's only action would be to open its corresponding
form. Then you can specify which macro to run at startup by
using the /X macroname command line option.
 
J

Joe

Yes this works fine when you are in the Access DB creating
code in the event of a form. I am looking for the DOS
command line to open a form from outside the DB.

Thanks again for the help.

Joe
 
J

JOE

I am trying to open a form from outside of Access.

I have a trigger on an SQL table that I want to add the
DOS command line to open the DB and the form.

Thanks for the help.

Joe
 
M

Marshall Barton

JOE said:
I am trying to open a form from outside of Access.

I have a trigger on an SQL table that I want to add the
DOS command line to open the DB and the form.


Yes, I understood that.

Assuming you have a macro named OpenMyForm that opens form
MyForm, then the command line would be:
"path to ms access" "path to your mdb file" /X OpenMyForm

If you're trying to find a way to do this without changing
the mdb file, I think you're out of luck.

BTW, it won't answer your question, but you can create a
desktop shortcut to a form by just dragging the form object
from the database window to the desktop.
 

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