Trapping Return in keypress()

D

dwetmore

In a textbox or combobox how do I get the "On Keypress" event to
detect a return. The code "If KeyAscii = vbKeyReturn" doesn't work (at
least for me.)

Thanks

Dave Wemore
 
J

Jeanette Cunningham

Hi Dave,
--use KeyCode instead of KeyAscii
--use it on the keydown event, not the keypress event

Jeanette Cunningham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top