I have an AfterUpdate code on a text box in a form that returns an error message when invalid data is entered and resets the field to a null value (thanks for your help).
However, it flicks the cursor to the next tab stop when the message box is closed and I would like the cursor to stay in the box. Is there a line of code that I can add that will do this?
My code is:
However, it flicks the cursor to the next tab stop when the message box is closed and I would like the cursor to stay in the box. Is there a line of code that I can add that will do this?
My code is:
Code:
Private Sub Closed_AfterUpdate()
If Closed > Date + 7 Then
MsgBox "This is an actual closed date and therefore must occur in the past. You may not enter a future date."
Cancel = True
Me.Closed = Null
End If
End Sub