Hello fellow access enthusisasts! I seem to be in the market for some help with creating a yes/no/cancel message box. I'll post the code i have so far below. Yes runs the code that is already there, saving the information and closing access, no is supposed to close without saving, and cancel cancels the action of closing access. P.S. this is in the unload portion of my form, so theres no way to close it without triggering this message box.
Code:
Dim strAnswer As String
strAnswer = MsgBox("Are you sure you wish to exit? Doing so will log you out. Please click Yes to Log-out.", vbQuestion + vbYesNoCancel, "Confirm")
If strAnswer = vbYes Then
Me!End_Time = Format(Now(), "hh:nn:ss")
DoCmd.Close acForm, "F_PartAdds"
Cancel = True
End Ifmes
good luck >.<