Keypress 
Author Message
 Keypress

I have 2 textboxes, one for lastname and other for firstname and a command
button. I enter a text in any of the following textboxes and get some
results. Instead of clicking the command button, I should get the results
just by hitting Enter from the Keyboard. I know we have to write some code
in the Keypress event of the textbox, but don't know exactly how to proceed.
Thanks for the help.

Harry



Sat, 17 Dec 2005 07:00:00 GMT  
 Keypress
hai Mr.Harry,
plz try this and get back to me , if u dont get
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MsgBox "hai" ' Mr Harry u can type ur codings here
End If

End Sub
take care

Quote:
>-----Original Message-----
>I have 2 textboxes, one for lastname and other for

firstname and a command
Quote:
>button. I enter a text in any of the following textboxes
and get some
>results. Instead of clicking the command button, I should
get the results
>just by hitting Enter from the Keyboard. I know we have
to write some code
>in the Keypress event of the textbox, but don't know

exactly how to proceed.
Quote:
>Thanks for the help.

>Harry

>.



Sat, 17 Dec 2005 14:57:07 GMT  
 Keypress

Quote:

>I have 2 textboxes, one for lastname and other for firstname and a command
>button. I enter a text in any of the following textboxes and get some
>results. Instead of clicking the command button, I should get the results
>just by hitting Enter from the Keyboard. I know we have to write some code
>in the Keypress event of the textbox, but don't know exactly how to proceed.
>Thanks for the help.

>Harry

Change the "Default" property of the button to "True".  Also, if you
have a "cancel" button on your
form, you should set the "Cancel" button of that property to "True"
(this makes it possible for the
user to cancel the operation by pressing "Esc".

Adelle.
http://www.akemi.com.au/vb/



Sat, 17 Dec 2005 17:24:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Fire the Click/KeyPress Event thru the code instead of trigger by the user mouse click/keypress ?

2. Simulating keypresses

3. KeyPress

4. No DELETE key acknowledgement wih KeyPress event

5. KeyPress action

6. Trap Keypress to igmore non numeric entries

7. Keypress detection during a powerpoint presentation

8. Textbox Filtering using KeyPress

9. refedit keypress

10. MSFlexGrid keypress event

11. Alternative to KeyDown/KeyPress?

12. VBA Forms and KeyPress Event?

 

 
Powered by phpBB® Forum Software