I have the following snippet of code, used in a database:
Private Sub Cancel_MAF_Click()
If Status.Value = "Incomplete" Then
MsgBox "This record can NOT be Canceled, please Delete this record!", vbInformation, "WARNING!"
DoCmd.RunCommand acCmdRefresh
ElseIf Status.Value = "Cancelled" Then
MsgBox "This record is already cancelled", vbInformation, "WARNING!"
Else
MsgBox "You are about to Cancel this record, are you REALLY sure you wish to do this? Re-Authorisation WILL be required if you do this in error", vbYesNoCancel
Status.Value = "Cancelled"
DoCmd.RunCommand acCmdRefresh
End If
End Sub
The problem here is, if you Click on either Yes, No, or Cancel the record is set to Cancelled. This is not really what I want. How do I get this to work?
Private Sub Cancel_MAF_Click()
If Status.Value = "Incomplete" Then
MsgBox "This record can NOT be Canceled, please Delete this record!", vbInformation, "WARNING!"
DoCmd.RunCommand acCmdRefresh
ElseIf Status.Value = "Cancelled" Then
MsgBox "This record is already cancelled", vbInformation, "WARNING!"
Else
MsgBox "You are about to Cancel this record, are you REALLY sure you wish to do this? Re-Authorisation WILL be required if you do this in error", vbYesNoCancel
Status.Value = "Cancelled"
DoCmd.RunCommand acCmdRefresh
End If
End Sub
The problem here is, if you Click on either Yes, No, or Cancel the record is set to Cancelled. This is not really what I want. How do I get this to work?