| Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As _ Integer) 'Put this code in the QueryUnload method of your form Dim iAns As Integer iAns = MsgBox("Are you sure you want to exit?", vbQuestion + _ vbYesNo, "Exit?") If iAns = vbNo Then Cancel = True End Sub |
Get User's Confirmation Before Unloading a Form |
Express News India | Freelance ecommerce web development India