I love the Search as you type to filter the list box. Now, I would like to select the "TOP" record in the list when I press Enter--as in an On Enter event. It would do the same thing as the On Click event to select an item from the List.
Kevin Robertson
@Reply 3 years ago
You can select the first item in the listbox like this (replace myListbox with the name of your listbox):
myListbox.SetFocus
myListbox.ListIndex = 0
To open the selected record when the user presses enter use the KeyPress event of the listbox:
If KeyAscii = vbKeyReturn Then
'code to open form
End If
Gary BeckerOP
@Reply 3 years ago
Wow! Yes, many thanks. I have a database where I store my logins & passwords for websites etc and this morning I wanted to update it with the "Search as you type" function. Here is the code I used--works great.
Gary BeckerOP
@Reply 3 years ago
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 8.