Is there a Database Close Event

L

Lisab

Is there a database Close event that I can add code to or
Is there a way to get code to run when the database close/quit

Thanks
 
J

Jeff Boyce

One approach to doing this is to open a (hidden) form when you open the
database. Add that code you want to have run when the db closes to that
hidden form.

When the db starts shutting down, but before it's done, that hidden form has
to close... and when it does, your code runs!

(I take this approach one step further and use the opening of the hidden
form and its closing to write (and update) a record in a table that
indicates who opened the app, when, and when it was closed by that same
person. I must be an auditor at heart...<g>)

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
L

Lisab

Thanks, I knew about this method form reading verious message boards. I
never had a need for it until now.

I was just hoping that by the time I needed it the version of Access, in
this case Access 2007, would have added a Database close event for us
developers to add code to.
 
J

JimBurke via AccessMonster.com

If you have a main form that stays open for the duration of a session (a
switchboard or anything similar) you should be able to put the code in that
form's close event rather than using a hidden form. I don't know of ANY
database-related events, but it could be handy if there were - in this case,
kind of like the opposite of an autoexec macro (I guess in a sense you can
look at the AutoExec macro like a database event). Maybe an AutoClose macro??
Thanks, I knew about this method form reading verious message boards. I
never had a need for it until now.

I was just hoping that by the time I needed it the version of Access, in
this case Access 2007, would have added a Database close event for us
developers to add code to.
One approach to doing this is to open a (hidden) form when you open the
database. Add that code you want to have run when the db closes to that
[quoted text clipped - 19 lines]
 

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