Open Database via .BAT file

madhouse

Registered User.
Local time
Today, 16:02
Joined
Jul 3, 2002
Messages
65
I've created a .bat file to open an MS Access database.....

C:
CD\Program Files\Microsoft Office\Office
Msaccess.exe C:\MMG\ORLCBS11\libinfo_viewer.mdb

But I was wondering if it was possible to open the database and specify a macro to run on startup so to speak i.e. can I pass some sort of parameter that holds the name of a macro which will run when the database is opened?
 
why not try this:

create a form
assign your macro to run "OnLoad" of the form (have Detail highlighted, right-click for Properties and assign a macro to an Event of "on load"

save the form

in the tools > startup options, specify this form to open when the database is opened.
;)
 
ok, the thing is that I already have a form specified in the startup options - this form is used by the staff to login to the database. The idea is that I want a means of bypassing the login form that opens on the database startup....don't ask why, long story....but it involves the use of an IBM AS/400 and remote commands!!
 
Check out the Startup command-line options in the Access help files for you can do what you want with the /x macro switch.

You can easily do this with VBA or a custom shortcut [alter the Tartget field of the shortcuts properties].

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\Database.mdb" /x YourMacro
 

Users who are viewing this thread

Back
Top Bottom