KeyPress?? 
Author Message
 KeyPress??

How do you use the KeyPress event?  I want to detect when
the user presses Enter and convert it to a TAB.  I can
only get the field's AfterUpdate event to work when the
user presses TAB.  I've tried to put it on OnExit,
BeforeUpdate, etc.  None really work, so I want to harvest
the actual keyboard command.

Either way, I'd still like to learn how to use the
KeyPress events.  I think eventually, I could use it.  Any
suggestions?

Crystal



Mon, 29 Aug 2005 02:46:57 GMT  
 KeyPress??
Hi Crystal,

In the form's On Key Press event you can use:

If KeyAscii = 13 Then KeyAscii = 9

make sure you set the form's Key Preview property to Yes. You can search
google on Ascii+Codes to get the ascii equivalents.

HTH
Steve C


Quote:
> How do you use the KeyPress event?  I want to detect when
> the user presses Enter and convert it to a TAB.  I can
> only get the field's AfterUpdate event to work when the
> user presses TAB.  I've tried to put it on OnExit,
> BeforeUpdate, etc.  None really work, so I want to harvest
> the actual keyboard command.

> Either way, I'd still like to learn how to use the
> KeyPress events.  I think eventually, I could use it.  Any
> suggestions?

> Crystal



Mon, 29 Aug 2005 04:44:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. In vbs exist the keypress event

2. Keypress event

3. Disabling shift keypress that prevents code execution

4. Keypress Counter

5. Capture keypress

6. Exit Loop on keypress?

7. Keypress

8. Help with Keypress

9. Can VBA intercept keypress within Excel ?

10. Recognizing keypresses


 
Powered by phpBB® Forum Software © phpBB Group