Hi Guys,
I have a Check box named "crypt" on a continuous form and I would like to pop up a message box depending on the value of the check box, Like this: If the Box is initially checked on load of the form and the user unchecked it, the message should say "...Click yes to continue or No to cancel" such that the click of "yes" would accept the User's unchecking of "crypt" and No would simply undo the update attempt. so I have this code
The Problem is the reverse does not work! That is if "crypt" is in an unchecked state and the User checked it, on Click of "No" the Undo does not work. That is the check does not clear on Undo, Why?
Any Help, please.
Warm Regards.
I have a Check box named "crypt" on a continuous form and I would like to pop up a message box depending on the value of the check box, Like this: If the Box is initially checked on load of the form and the user unchecked it, the message should say "...Click yes to continue or No to cancel" such that the click of "yes" would accept the User's unchecking of "crypt" and No would simply undo the update attempt. so I have this code
Code:
Private Sub crypt_AfterUpdate()
Dim Msg, Style, Title, Ctxt, Response, MyString
If crypt.Value = 0 Then
Msg = "Are You sure you have unlocked the PDF?" & _
"Click Yes to continue or No to Cancel"
Style = vbYesNo + vbExclamation + vbDefaultButton2
Title = "File Unlock Warning"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Ctxt)
If Response = vbYes Then
MyString = "Yes"
Cancel = True
Else
MyString = "No"
DoCmd.RunCommand acCmdUndo
End If
End If
End Sub
Any Help, please.
Warm Regards.
Comment