press enter

  • Thread starter Thread starter wd1153
  • Start date Start date
W

wd1153

hi,

I have a textbox and a button. the textbox is for user to
enter searching criteria, after the user click on button,
the code runs to search records according the textbox
content. My question is how do I make it beheave like:
user either click on the button or just press 'enter' key
after entering some search criteria in textbox to make it
run the code. Currently, after I press enter, the focus
move to the button, then I have to press again to make it
run. I am sure it has to do with keypress event of the
txtbox. But how?
 
expanding on what William suggests, put the (command button's 'on click'
event) code in the after update event of the textbox... so that your textbox
will perform what your command button does, and you can then get rid of your
command button too!

OzPete
 
Back
Top