Page 1 of 1

pop up a box if the x button is clicked

PostPosted: Wed Aug 27, 2008 6:46 pm
by chubzyko
Code: Select all
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    ' Only prompt if the user hits X
    If UnloadMode = 0 Then
        If Msgbox("Are you sure you want to quit?", vbYesNo Or vbQuestion) = vbNo Then Cancel = True
    End If

End Sub