Enter/return key - does not fire event

klaus2000

New member
Local time
Yesterday, 21:49
Joined
Jul 1, 2015
Messages
2
hi,
when pressing the return key (in a textbox field within a form) an action should be fired, but it does not.

here is my code:
************************
Private Sub txmyTextbox_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MsgBox "Return key pressed"
End If
End Sub
*****************
any idea whats wrong
 
dont use keypress,
use keyDown (this works)
if so, its no longer keyascii but rather: if KeyCode = vbKeyReturn (or 13)
 
thank you very much!! it works!
 

Users who are viewing this thread

Back
Top Bottom