AutoExec Macro

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
 
G

Guest

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
 
G

Guest

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?
 
S

Steve Schapel

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.
 
G

Guest

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
 
S

Steve Schapel

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"?
 

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