I have a text box that I don't want people to be able to tab out of. In the KeyPress event, I already tried this code:

If KeyAscii = vbKeyTab Then KeyAscii = 0

But it didn't work. It still tabs out of the textbox. I also tried:

If KeyAscii = vbKeyTab Then
KeyAscii = 0
Cancel = 1
End If


And

If KeyAscii = vbKeyTab Then
KeyAscii = 0
txtedit.SetFocus
End If


But that didn't work either. Any suggestions on how to keep it from tabbing out of the textbox?

------------------
Ryan