Hi
I use the following code in a text box.
vUcase = UCase(TxbCCID.Value)
vUcaseLen = Len(vUcase)
If vUcaseLen <> 4 Then
MsgBox ("Cost Centre Code requires 4 chars")
TxbCCID.SetFocus
Else
TxbCCID.Value = vUcase
End If
Issue is that if less than 4 characters put in and user press TAB key then the setfocus is ignored.
Can / is there a code than can be used in the error trap so to stay in the field.
many thanks in advance for any solutions.
Forest
I use the following code in a text box.
vUcase = UCase(TxbCCID.Value)
vUcaseLen = Len(vUcase)
If vUcaseLen <> 4 Then
MsgBox ("Cost Centre Code requires 4 chars")
TxbCCID.SetFocus
Else
TxbCCID.Value = vUcase
End If
Issue is that if less than 4 characters put in and user press TAB key then the setfocus is ignored.
Can / is there a code than can be used in the error trap so to stay in the field.
many thanks in advance for any solutions.
Forest