titorober23
asked on
SetFocus after validate textbox, not working
Hi Guys
For some reason SetFocus is not working, it goes to the next control
Private Sub DateOfBirth_AfterUpdate()
If Not IsNull(Me.DateOfDeath) Then
If Me.DateOfBirth >= Me.DateOfBirth Then
MsgBox "Date of Birth must be smaller than Date of Death", , "Date Of Birth"
Me.DateOfBirth.Value = ""
Me.DateOfBirth.SetFocus
End If
End If
End Sub
Any thoughts
BEst regards
For some reason SetFocus is not working, it goes to the next control
Private Sub DateOfBirth_AfterUpdate()
If Not IsNull(Me.DateOfDeath) Then
If Me.DateOfBirth >= Me.DateOfBirth Then
MsgBox "Date of Birth must be smaller than Date of Death", , "Date Of Birth"
Me.DateOfBirth.Value = ""
Me.DateOfBirth.SetFocus
End If
End If
End Sub
Any thoughts
BEst regards
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The message box has the description right for the validation check, but the code should be comparing DateOfBirth with DateOfDeath.