Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keypress for enter in text box
I have desingned a Worksheet that access information on Access mdb. I need to
complete criteria in a text box and I want to trigger the VBA routine when I press return key (keypress for ASCII 13) but it does not seems to work Here is an example of what I'm doing: Private Sub txtibs_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If KeyAscii = 13 Then Sheets("Base").cmdfind.Click End If End Sub Any ideas? Thanks, from Argentina, Ignacio |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keypress for enter in text box
"Nacho" wrote in message
... I have desingned a Worksheet that access information on Access mdb. I need to complete criteria in a text box and I want to trigger the VBA routine when I press return key (keypress for ASCII 13) but it does not seems to work Here is an example of what I'm doing: Private Sub txtibs_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If KeyAscii = 13 Then Sheets("Base").cmdfind.Click End If End Sub Hi Ignacio, The KeyPress event doesn't fire in a UserForm in response to the Enter key. You'll need to use the KeyDown event instead. -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keypress for enter in text box
Don't use the KeyPress event. Use the KeyUp event.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Nacho" wrote in message ... I have desingned a Worksheet that access information on Access mdb. I need to complete criteria in a text box and I want to trigger the VBA routine when I press return key (keypress for ASCII 13) but it does not seems to work Here is an example of what I'm doing: Private Sub txtibs_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If KeyAscii = 13 Then Sheets("Base").cmdfind.Click End If End Sub Any ideas? Thanks, from Argentina, Ignacio |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Keypress and "Enter" key | Excel Programming | |||
KeyPress Events | Excel Programming | |||
Keypress nest | Excel Programming | |||
keypress | Excel Programming | |||
KeyPress Event | Excel Programming |