This event occurs when a form is unloading.
Private Sub form_Unload(cancel)
The QueryUnload event occurs in all forms before any are unloaded, and the Unload event occurs as each form is unloaded.
If you use App.End to terminate an application, forms do not execute the QueryUnload and Unload events.