Is there an "On Close" event for MS Access VBA?

S.. picture S.. · Aug 21, 2012 · Viewed 22.3k times · Source

Am trying to perform some specific actions, before closing the access database (whenever the database is closed by the user).

I know we can use Auto_Close function in Excel VBA to force events before closing the book. Is there a similar function in MS Access VBA? If so, an example would be appreciated.

Please let me know if you need more information. Thank you.

Answer

Phil.Wheeler picture Phil.Wheeler · Aug 21, 2012

No, there isn't an application quit or close event for MS Access. The common approach seems to be having a hidden form open at all times and then handling any logic for the application within the unload event for that form (which will always be fired before Access completely closes).