solotoo
Registered User.
- Local time
- Today, 06:26
- Joined
- Nov 16, 2004
- Messages
- 14
Help please
I have created a form in Excel with text entry boxes, in the first box the text required is either A,B or C.
If an incorrect letter is entered I want to focus to go back to this cell. But I can t seem to manage this.
The code I have is...
Private Sub txt_ABC_Exit(ByVal Cancel As MSForms.ReturnBoolean)
txt_ABC.Text = UCase(txt_display.Text)
If txt_ABC.Text Like "[A,B,C]" <> False Then
txt_NEXT.SetFocus
Else
txt_ABC.SetFocus
lbl_error.Caption = "Error, incorrect entry"
'txt_ABC.SelStart = 0 ' tried this - didnt work!!
End If
End Sub
I can get focus on any other text box but the one I want!
Any ideas greatfully received.
I have created a form in Excel with text entry boxes, in the first box the text required is either A,B or C.
If an incorrect letter is entered I want to focus to go back to this cell. But I can t seem to manage this.
The code I have is...
Private Sub txt_ABC_Exit(ByVal Cancel As MSForms.ReturnBoolean)
txt_ABC.Text = UCase(txt_display.Text)
If txt_ABC.Text Like "[A,B,C]" <> False Then
txt_NEXT.SetFocus
Else
txt_ABC.SetFocus
lbl_error.Caption = "Error, incorrect entry"
'txt_ABC.SelStart = 0 ' tried this - didnt work!!
End If
End Sub
I can get focus on any other text box but the one I want!
Any ideas greatfully received.