|
-
Oct 4th, 2000, 04:45 PM
#1
Can you tell me wich is the ascii code for the enter button please and can you tell me also if this code is correct:
Code:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 28 Then
Command1_Click
End If
End Sub
numibesi
-
Oct 4th, 2000, 04:49 PM
#2
Monday Morning Lunatic
If you set the form's KeyPreview property to true, then that's fine. Also, I would suggest using the constant vbKeyEnter rather than a number.
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
-
Oct 4th, 2000, 04:49 PM
#3
Change 28 to 13, which is the Ascii for Enter/Return
Code:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 28 Then
Call Command1_Click
End If
End Sub
-
Oct 4th, 2000, 04:52 PM
#4
It doesn´t work
It doesn´t work, it could be probabli because the 28 isn´r the nr for the enter button on ascii code.
-
Oct 4th, 2000, 04:56 PM
#5
Sorry Megatron
Thank you megatron, but i was looking for other threads and i found that i could use vbKeyReturn insted of vbKeyEnter that doesn´t work.
Thank you both, numibesi
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
|