How to find out how the form is unloading
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 'Forms - How to find out how the form is unloading Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Select Case UnloadMode Case vbFormControlMenu ' = 0 ' Form is being closed by user. Case vbFormCode ' = 1 ' Form is being closed by code. Case vbAppWindows ' = 2 ' The current Windows session is ending. Case vbAppTaskManager ' = 3 ' Task Manager is closing this application. Case vbFormMDIForm ' = 4 ' MDI parent is closing this form. Case vbFormOwner ' = 5 ' The owner form is closing. End Select End Sub |