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
 
L

Linq Adams via AccessMonster.com

If KeyAscii = 13 Then

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
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