Hi,
I have a text box on form set to Long Text. It is set to no for tab stop. The user makes notes in it on clients. If they hit the enter key to go to the next line in the box they are fine. However if they hit tab by accident they go to the first field in the record. Their goal is to have nothing happen if they hit tab. Is there code for that and what event would it be put on. I've tried various things but nothing has worked.
Thanks,
Leesha
Disable Tab Off a Text Box
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Disable Tab Off a Text Box
Create an On Key Down event procedure for the text box:
Change TextBoxName to the name of your text box.
Code: Select all
Private Sub TextBoxName_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyTab
KeyCode = 0
End Select
End Sub
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1484
- Joined: 05 Feb 2010, 22:25
Re: Disable Tab Off a Text Box
Perfect! Thanks so much!!