My DBMS has a main switchboard which is opened by autoexec and remains open for the life of the session; it contains an "Exit Database" button which performs some housekeeping such as logging the event, before executing the Application.Qui t.
The problem is that some users are closing the application by using the "X" close button on the application title bar, thus bypassing the closing housekeeping. So I have tried to inhibit that by setting a global flag in the cmdDatabaseExit OnClick procedure and checking this flag in the Switchboard.Unl oad procedure. If the flag isn't set, I want to display a message and cancel the Unload action. However I am thwarted by the fact that Access closes the switchboard form when I want to switch to design view, so my Unload procedure prevents this. I have tried numerous ways around this, using switches to handle the re-entry to the procedure etc, but nothing works. Am I trying to do the impossible, or is there a better way to solve the problem?
The problem is that some users are closing the application by using the "X" close button on the application title bar, thus bypassing the closing housekeeping. So I have tried to inhibit that by setting a global flag in the cmdDatabaseExit OnClick procedure and checking this flag in the Switchboard.Unl oad procedure. If the flag isn't set, I want to display a message and cancel the Unload action. However I am thwarted by the fact that Access closes the switchboard form when I want to switch to design view, so my Unload procedure prevents this. I have tried numerous ways around this, using switches to handle the re-entry to the procedure etc, but nothing works. Am I trying to do the impossible, or is there a better way to solve the problem?
Comment