I know that if you define an AUTOEXEC macro that it will automatically run each time the Access database is opened. Is there a way to define a macro or VBA function or subroutine that will automatically be executed if the user selects "X" close button in the upper right-hand corner of the Access window or at any other time Access is closed by any other method? Thanks in advance...