How can I make the textboxes detect when they are filled up and then skip to the next text box... and I tend to place my boxes out of order due to rearranging stuff all of the time, how do I rearrange the order they go in when you hit tab..?
Printable View
How can I make the textboxes detect when they are filled up and then skip to the next text box... and I tend to place my boxes out of order due to rearranging stuff all of the time, how do I rearrange the order they go in when you hit tab..?
Each textbox has a TabStop property. Focus starts on TabStop 0, then goes to 1, etc...
Work it backwards...go to your controls and set the tabIndex to 0 and keep setting each and every one to 0 till you reach the one that you want first. Now all your tabs will be in the order you want...tabbing from first to last.
allright, thanks that worked fine, but what about the skip thing? Kind of like how Microsoft and other programs do with the cdkeys when you enter them... You enter the first few numbers, then when that box is filled, it skips to the next...
the easiest way would be to use a control array...
Code:Private Sub Text1_Change(Index As Integer)
On Error Resume Next 'needs to be here
If Len(Text1(Index).Text) = 5 Then '5 or what ever number
Text1(Index + 1).SetFocus
EndIf
End Sub
it says...
???????Quote:
procedure declaration does not match description of event or procedure having the same name
do you have it set up as a control array?? ie - Text1(0), Text1(1), and so on??
lol, do now, and it works.. but on the last one, i want them to be able to enter 4 digits... what should i do there? (btw, there are 3 boxes..)
I think that will work...Code:Private Sub Text1_Change(Index As Integer)
On Error Resume Next 'needs to be here
If Len(Text1(Index).Text) = Text1(Index).MaxLength Then
Text1(Index + 1).SetFocus
EndIf
End Sub
Thanks! You have been great help!
for some reason my last post was edited instead of making a new post, just look up...