Why would you hit the Tab key? Tabs don't work in Access controls...
To stay in the same textbox when hitting Enter, set the EnterKeyBehavior
property for the text box.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
Hi Doug,
Why wouldn't you hit the Tab key? Unless you've set tab stop to No for
every control on your form, the Tab key will cycle through the controls
(move focus to the next control in the tab order); it may even move to the
next record, depending on the Cycle property setting for the form itself.
I think the OP needs to put code into the KeyDown event for the control in
question, and do nothing if the key code is either 9 (tab key) or 13 (enter
key). It's not something I've ever done, so I don't know exactly what is
needed to cancel the key's action (the KeyDown event doesn't have a Cancel
parameter), but it shouldn't be too hard.
Rob
> Why would you hit the Tab key? Tabs don't work in Access controls...
>
[quoted text clipped - 10 lines]
>>
>> Jason.
Douglas J. Steele - 26 May 2008 15:30 GMT
You're right. I was reading it as he wanted to be able to insert tabs into
the text.
Jason: Set the KeyPreview property of the form to True, and add code like
the following to the KeyPress event of your textbox:
Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 9, 13
KeyCode = 0
Case Else
End Select
End Sub
(replace Text0 with the actual name of your text box)
Note that the above means that the Enter key will be ignored. If you want
the Enter key to put a carriage return/line feed into your text, remove the
", 13" from the code above, and set the EnterKeyBehavior property as I
previously suggested.
Sorry for the confusion.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Hi Doug,
>
[quoted text clipped - 25 lines]
>>>
>>> Jason.