One technique I've used in the past is to hide a command button somewhere (or leave it visible, so the mouse can also be used) and set its .Default property to True. That way, as far as I can recall, it should trigger when Enter is pressed. However, I seem to also remember that it still beeps, so you may need to use xLin's code to suppress that.
Note, it might be better to use the form's KeyPress or KeyDown event, rather than the textbox's, but to do that you need to set the form's KeyPreview property to True.
(Note: by "hide" I mean to obscure it behind something or off the edge of the form. If you actually set it to not visible, I'm pretty sure it won't respond to any user events.)
Comment