hiiiii all
i have a continous sub form in (ExpiryDate) field ,beforeupdate event i try to get msg, when user enters date before this today date , but it coud not work:
i try this code
what is the wrong in that code ?
i have a continous sub form in (ExpiryDate) field ,beforeupdate event i try to get msg, when user enters date before this today date , but it coud not work:
i try this code
Code:
Private Sub ExpiryDate_BeforeUpdate(Cancel As Integer)
If Me.ExpiryDate < Date Then
If MsgBox("please enter a date greater than today, are you sure ? " & vbCrLf & _
Date, vbInformation + vbMsgBoxRtlReading + vbMsgBoxRight + vbYesNo, " be sure ") = vbYes Then
Cancel = False
Else
Cancel = True
Me!ExpiryDate.Undo
End If
End If
End Sub
what is the wrong in that code ?