Ok, so here is my code for the validation of my form :
Private Sub AvailablePeriodEnd_BeforeUpdate(Cancel As Integer)
If [AvailablePeriodStart] > [AvailablePeriodEnd] Then
MsgBox ("You have entered a date wrongly")
Me!AvailablePeriodEnd = ""
End If
End Sub
However the code in red gives me an error everytime. How do i replace this code with a code that resets the value in the AvailablePeriodEnd field? I just want the field to be blank/reset value if the user enters a date that is less than the start date.
Private Sub AvailablePeriodEnd_BeforeUpdate(Cancel As Integer)
If [AvailablePeriodStart] > [AvailablePeriodEnd] Then
MsgBox ("You have entered a date wrongly")
Me!AvailablePeriodEnd = ""
End If
End Sub
However the code in red gives me an error everytime. How do i replace this code with a code that resets the value in the AvailablePeriodEnd field? I just want the field to be blank/reset value if the user enters a date that is less than the start date.