Is it possible to determine in code what's caused a form to be unloaded / closed?
If I've got a form open I can close the form by clicking on the close button in the top right-hand corner. But the form will also be closed if I click on the close button on the outer Access window and close down Access itself.
Is there a way within the form itself of determining which of those two methods - or indeed any other - is causing the form to unload / close?
Or a way within Access to pick up the fact that the user has clicked to close the main Access window?
If I've got a form open I can close the form by clicking on the close button in the top right-hand corner. But the form will also be closed if I click on the close button on the outer Access window and close down Access itself.
Is there a way within the form itself of determining which of those two methods - or indeed any other - is causing the form to unload / close?
Or a way within Access to pick up the fact that the user has clicked to close the main Access window?