How to Open an Access Form from the command line

J

Jeff Greenlee

I have another application (Non-Microsoft) that referes to an object with a
label that has the same value as the one in my key field in my Access
Database. This application allows opening an app from the command line. I
would love it if I could execute that and have the Access form referring to
that specific record pop up when called. I have found Documentation on how
to Bring up a form from the command line... but it doesn't get into specifics
on how to bring up a queried Record in that form from the command line.
 
M

Mike Labosh

You can dig this out of the help file, but Access lets you pass command line
parameters to it to run a particular mdb, and pass parameters to the mdb.
Something like this:

msaccess.exe my.mdb /run FormToOpen RecordKeyToGet

And then perhaps your autoexec macro runs a startup function that can get
these from the command line via Command$. Now you know which form to open
from the Forms collection, and you can call a method in that form passing
the key, and the method filters on that key.

I had to do that in 1994 in Access 2.0 where some COBOL program would export
some stuff and then some ghastly JCL would spit the customized command line
back to the terminal emulator so the user could paste it into a Run box to
run the import batch.

:: shiver ::
--
Peace & happy computing,

Mike Labosh, MCSD

Feed the children!
Save the whales!
Free the mallocs!
 
Top