Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tab thru and leave the focus on last textbox

Status
Not open for further replies.

sophia03

Programmer
Apr 12, 2004
9
US
I have a form with 5 textboxes on it. I can tab thru them from 1 to 5. When it gets to textbox 5, i want focus to stay in that box, no matter how many times i hit tab after that. I don't want it to go back to textbox 1. If anybody knows answer to this i would realy appreciate the help.
 
Something like this ?
Private Sub TextBox5_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyTab Then KeyCode = 0
End Sub


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top