|
-
Aug 13th, 2000, 05:54 PM
#1
Thread Starter
New Member
HOW DO I FIND OUT WHETHER USER HITS THE ENTER KEY???
GETKEY?........
KEYPRESS?......
THANKS FOR THE HELP
-
Aug 13th, 2000, 05:58 PM
#2
You can check the KeyAscii value in the KeyPress event. Just check if KeyAscii = vbKeyReturn.
Good luck!
-
Aug 13th, 2000, 05:58 PM
#3
Monday Morning Lunatic
The Object_KeyPress event should do the trick. Check for vbKeyReturn or vbKeyEnter.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 13th, 2000, 06:02 PM
#4
Do you want to know if it's pressed when your window has the focus? Or anywhere in windows?
-
Aug 13th, 2000, 06:05 PM
#5
If you want to detect the KeyPress regardless of which object has the focus, use the following code.
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then MsgBox ("Enter was pressed")
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|