seanlhall
asked on
How can I run code on Enter press in a textbox?
I have a text box called TxtSearch and a command button. A search tern is entered in the text box and then the user clicks the command button. How can I have the user enter the search term and just hit enter to run the code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you tried using the AfterUpdate event of the textbox?
I believe that gets fired when the Enter Key is hit, as long as the textbox's Enter Key behavior property is set to 'Normal', not 'New Line In Field'.
I believe that gets fired when the Enter Key is hit, as long as the textbox's Enter Key behavior property is set to 'Normal', not 'New Line In Field'.
Private Sub YourSearchTextBoxName_Afte
' your search code here
End Sub
mx