possible to open an Access form on a specified record from command line?

Zarty

Registered User.
Local time
Today, 21:25
Joined
Jul 4, 2008
Messages
20
Is it possible to open an Access form from the command line with a parameter so that the form opens up and displays at the record defined by that parameter?

So, for example, if the main 'Primary Key' field at the top of the form was called 'ID' with a numeric value, could that ID be passed in as a command line parmater to open up the form on that record?

Thanks
Zarty
 
Use the /x <macroname> to execute a macro or /cmd <command> to execute whatever you want. I'd use the latter.

I use a shortcut:
Code:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /cmd "FromShortcut" "E:\Work\StamBestanden\Stam_App.mdb"
To make sure that my database application is started from a shortcut.
Code:
Public Function InitApp()

    If IsNull(Command) Or Command <> "FromShortcut" Then
       MsgBox "This database must be opened using the shortcut!", vbCritical, GetAppTitle
       DoCmd.Quit acQuitSaveNone
    End If

Command can hold anything. That's what you want i believe.

enjoy!
 
Thanks. useful.
 

Users who are viewing this thread

Back
Top Bottom