I have code that checks a date in a field to see if it is less than or equal to the current date. I have it on the BeforeUpdate Event of the Field, so the focus automatically goes back to this field, but the old date that the user entered is still sitting there.
After the cursor's focus is back in that field, I would like to have the field wipe out the old date (clear the field) and be blank and ready for the user to enter the correct date.
When I tried putting in the following line of code: me.Quality_Review_Date.value = ""
after the line of code "Cancel=True", I get run-time error '2115'.
Below is the code I'm using to check the Date field:
If Me.Quality_Review_Date.Value > (Date) Then
MsgBox ("You must enter a date less than or equal to today's date!")
Cancel = True
What do I need to do to accomplish this?