AutoExec Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know when an Access database is opened, if the AutoExec macro exists it
gets run.

Is there something similar for when an Access database is closed?

TIA
 
Hi,
when your db starts up the first time open a specific form and make it
hidden. Now you can use this form's unload event to execute any code you need
since the form will be automatically close by access before shutdown.
HTH
Good luck
 
I thought of doing that but
1 - Was hoping that Access provided a mechanism similar to the AutoExec macro
2 - Did not want to have the overhead of an extra form in memory

Got any more ideas?
 
Steve,

No, there is no euivalent to AutoExec at closedown of the database.

As well as Oliver's suggestion of a hidden form specific for the
purpose, and using its Close event for your macro, the design of many
Access applications has a form (menu/switchboard?) which is always open
when the database is open anyway, and if this is the case then you can
of course use the Close event of this form instead.
 
Steve,

Thanks for confirming that there is no equivalent to AutoExec at closedown
of the database and supporting Oliver's solution.

Right now I'm able to accomplish everything this app requires using a custom
command bar (no forms but many tables and queries). I guess I'm going to
have to bite the bullet and add an invisible form.

Thanks again to you and Oliver.

-Steve
 
Steve,

Fair enough... different strokes for different folks. Main reason for
most people using Access, I imagine, is Forms functionality. Are you
aware of the "edict" that "tables are for the purpose of data storage
and are not for human consumption"?
 
Back
Top