selecting number and enter key to open form

Status
Not open for further replies.

Gazza2

Registered User.
Local time
Yesterday, 22:08
Joined
Nov 25, 2004
Messages
184
I am trying to figure out how to select a number on a menu and press the enter key to open a form.
I have the following code in the keypress event of a text box

Private sub text1_keypress(keyascii as integer)
select case keycode
case vbkey1 + vbkeyreturn
keycode = 0
do.cmd.openform"form1",acnormal
end select

end sub

All that happens when i type a number and press the enter key is the number disappears.
i have the forms keypreview set to yes.
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom