D
dvlander
I wrote the brief VBA code below in the After Update event of a text box
control. It's working fine except the focus is ending up in the next field
in the Tab Order instead of returning to the this text box so the user can
enter data that fits the If statement's criteria. Is there something I need
to do differently? Thanks in advance for the help.
Dale
Private Sub txtAssignmentStartDate_AfterUpdate()
If CDate(txtAssignmentStartDate) < CDate(txtProjectStartDate) Then
MsgBox "The Assignment Start Date cannot be earlier than the Project Start
Date of " & txtProjectStartDate
DoCmd.GoToControl "txtAssignmentStartDate"
Else
End If
End Sub
control. It's working fine except the focus is ending up in the next field
in the Tab Order instead of returning to the this text box so the user can
enter data that fits the If statement's criteria. Is there something I need
to do differently? Thanks in advance for the help.
Dale
Private Sub txtAssignmentStartDate_AfterUpdate()
If CDate(txtAssignmentStartDate) < CDate(txtProjectStartDate) Then
MsgBox "The Assignment Start Date cannot be earlier than the Project Start
Date of " & txtProjectStartDate
DoCmd.GoToControl "txtAssignmentStartDate"
Else
End If
End Sub