Posted on October 5, 2011
1
2
3
4
5
6
7
8
| 'Forms - How to cancel the user action when the user trying to close the application using task manager.
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
' Don't let the user close this form.
Select Case UnloadMode
Case vbFormControlMenu, vbAppTaskManager
Cancel = True
End Select
End Sub |