Enter key search

IpeXeuS

Registered User.
Local time
Today, 23:58
Joined
Nov 23, 2006
Messages
98
Hello there, ;)

I've a bit problem with my search feature and enter key. Ok, first of all I got one form wheres like subform that includes lots of fields etc, but nevermind those. I got search field in main form and button for that as well. I was just added feature, so when user define search criteria into text field and hits enter, program will automatically start searching matching records, but now user need to click that button to do that.

Below is a bit code what I'm using in search field keydown event:

Code:
If Keycode = 13 then
Me.[cmd_Search].SetFocus
Call cmd_Search_Click
End If

Everything works fine, search will complete and program informs user if theres matching records or not, but then here's this bug. I focused search button earlier in text field keydown event and now I trying to focus back to that search field, but that just doesn't work. Search button just stays focused, no matter what I do.

So now I'll ask your advices and help with this. :(

All replies are approciated a lot.

Thanks for your time. :cool:
 
All you need to do is to put your code for the search in the click event of the button and in the button's properties dialog find the property called DEFAULT and change from NO to YES. Then, when the person enters their criteria and hits the Enter Key it will click the button for you without having to be on the button.
 
Thank's for your tip, but what happens then when user hits enter to add new line to larger memo textarea for notes? :confused:
 
They should be able to use SHIFT + Enter to add a new line.
 

Users who are viewing this thread

Back
Top Bottom