I created a form with three text fields. I introduced the characters and for a while laid a tab on the next one without repeating your problem.
The only way to get a tab in the text box is to enter Ctrl + Tab. It may be awkward, but the backspace removes it, so this is not a serious problem. Is it possible that you accidentally pressed Ctrl at the same time?
Sometimes I find that if I miss a key, the cursor will move to another place on the screen. I am not quite sure what I mean by "fallacy"; This seems to be due to the simultaneous pressing of two keys. This is apparently a feature of modern keyboards and how they detect which key was pressed because I ran into it on different computers. The implication is that by running the key, a control character is generated (possibly a tab or ctrl + tab).
I also tried the following, which worked and hides the problem by deleting the tab and moving on to the next control.
Private Sub TextBox1_Change() If InStr(1, TextBox1.Text, Chr(9)) <> 0 Then TextBox1.Text = Replace(TextBox1.Text, Chr(9), "") TextBox2.SetFocus End If End Sub
Tony dallimore
source share