The Cancel is not working--when it set focus it does not undo the delete. I thought entering Cancel = True will undo the delete. Below is the code:
The below code is not catching the wrong dates:
Thanks for your help!
Private Sub Form_BeforeUpdate(Cancel As Integer)
If (Me.txtEventDate & "" = "") Then
End SubIf MsgBox("You deleted the date. Save anyway?", _
vbYesNo + vbQuestion + vbDefaultButton2, gstrAppTitle) = vbNo Then
End IfvbYesNo + vbQuestion + vbDefaultButton2, gstrAppTitle) = vbNo Then
Me.txtEventDate.SetFocus
Cancel = True
ElseCancel = True
DoCmd.Close acForm, "fdlgEventDetail", acSavePrompt
End If
The below code is not catching the wrong dates:
Private Sub txtEventDate_BeforeUpdate(Cancel As Integer)
If (txtEventDate) >= #1/1/1900# Then
End SubMsgBox ("Event Date must be greater than 1/1/1900."), vbCritical, gstrAppTitle
Me.txtEventDate.SetFocus
Cancel = True
End IfMe.txtEventDate.SetFocus
Cancel = True
Thanks for your help!