Trapping Enter Keystroke

MikeLeBen

Still struggling
Local time
Today, 14:48
Joined
Feb 10, 2011
Messages
187
Hello dear readers,

I am trying to implement a bound (to an RTF memo field) txtbox on a form and I can't find a workaround for an annoying default feature of access: my "enter" key keystrokes move to next record.

I managed to prevent this behavior, at least, with a key capture routine, but I would like the return key to feed a line and return carriage (like it would in Word) so that the user can modify the contents of the box.

Method #1 on keydown event only adds the line at the end of the existing text, but I couldn't come up with another solution (the newline should be put where the blinking marker is)
for reference:
Code:
me.txtbox = me.txtbox & vbCrLf

Any ideas?
 
I believe TextBox controls have a property on the Other tab for "Enter Key Behavior".
 
That did it. Lovely :)
 

Users who are viewing this thread

Back
Top Bottom