Why aren't there Application Events for Access?

D

dch3

Can someone explain to my why MS hasn't add Events for the Application object
(Startup, Exit, etc.) just like the other Office apps? How many times have we
seen a poster asking about running code at Startup or when the Application
shuts down?
 
D

Douglas J. Steele

Running code at startup is there: you can use a macro named AutoExec or
designate a start up form and put code in its Open event.

Running code at shutdown can be accomplished by having a form that's always
open, and putting code in its Close event.

Or are you talking about events to run when Access itself opens, before the
database opens? I can't really see a need for that.
 
D

dch3

I wasn't referring to the workarounds, but rather the fact that Access
doesn't have buildt-in functions like the other Office Apps.

Excel has a variety of events for the Application object including
..WorkbookBeforeClose and .WorkbookOpen. Word has similar events
..DocumentBeforeClose and .DocumentOpen. Outlook has .Startup and .Quit.

While I would love TABLE-level events similar to TRIGGERS in a full-fledged
database, I fully understand that it may not be possible because the actions
are handled by JET and the architecture may not exist for communication
between MSACCESS.EXE and the JET DLL.

But what I don't understand is why MS hasn't built into the .EXE code which
detects when methods like .NewCurrentDatabase, .CloseCurrentDatabase and
..Quit are called - either directly in VBA or via the Toolbar/Ribbon. If the
method is executed, you could certainly fire an associated event.
 
D

dch3

and I forgot one point... you can set a database to compact on close, so
obviously it is possible to detect application level events.
 

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