Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keypress and "Enter" key Thomas[_13_] Excel Programming 1 October 27th 04 01:24 PM
KeyPress Events Daniel F Excel Programming 0 June 30th 04 04:44 PM
Keypress nest Garry Jones Excel Programming 4 October 21st 03 02:56 PM
keypress Garry Jones Excel Programming 2 October 17th 03 09:47 AM
KeyPress Event Conrado Capistrano Excel Programming 4 September 25th 03 05:27 AM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"