Using to following code to check the control for 6 characters. if not, then display message and clear the control, and set the focus back to the control. This code is in the Lost Focus event of the control. However, the cursor never goes back to the examined control and remains in the control that is next in the tab sequence on the form. I've tried moving the setfocus after the MsgBox, but to no avail.
'Check for length of 6 Chars
If Len(Card_No) <> 6 Then
Card_No.Value = ""
Me.Card_No.SetFocus
MsgBox "Wrong Number of characters"
Else
End If
Thanks in advance
'Check for length of 6 Chars
If Len(Card_No) <> 6 Then
Card_No.Value = ""
Me.Card_No.SetFocus
MsgBox "Wrong Number of characters"
Else
End If
Thanks in advance