Can Combo Boxes Work With Arrow Keys?

Reese

Registered User.
Local time
Today, 14:41
Joined
Jan 13, 2013
Messages
387
[Solved] Can Combo Boxes Work With Arrow Keys?

As a user types, combo boxes have a "live update" function that fills in the rest of the box based on the row source of the combo box.

This is a great feature but does anyone know if a user can use the arrow keys to navigate through the current options based on what they have currently typed?

I'm thinking of something like when you are typing something into an internet search engine, multiple content options appear below and you can either continue typing--thus narrowing the result--or use the arrow keys or mouse to select one of the content options that have appeared.

Is there any function similar to this in Access?

Thanks.
 
Last edited:
Once a combo is dropped down, you can navigate the highlight in the combo using the up and down arrow keys. You can programmatically force the combo to drop down using the combo's .Dropdown method.
Hope this helps,
 
Thanks for the suggestion. That gets me part way there. I was hoping that typing would also narrow down the options in the combo box.

For example:

I have a combo box for zip codes that uses a query for a row source. This query pulls all of the zip codes in past records. As a user types I would like the drop down options to narrow down like this:

-User types "1" and only zip codes that start with "1" appear in the drop down
-User types "3" and the drop down now only displays zip codes that start with "13"
-User types "9" and the drop down now only displays zip codes that start with "139"
etc.

Do you know if that is possible?
 
That "list shortening" behaviour is not native to an Access.ComboBox, but Access does automatically display the best match it can find in a combo based on what you've already typed. If, in addition to that, your list is sorted, then as you type you will be automatically navigated to part of the list most relevant to what you've typed.
Cheers,
 
MarkK, thanks for the help. It's not *exactly* what I'm looking for but using the Dropdown function in the On_Dirty and On_Change event procedures seems to create the same type of effect.

Burrina, thanks for the suggestion but that utility is essentially a search function with a combo box that determines which field to search in and a text box that searches for a given value. What I'm looking for involves a combo box that is bound to one field and simply narrows down the options. Thanks for trying, though!
 
As a user types I would like the drop down options to narrow down like this:

-User types "1" and only zip codes that start with "1" appear in the drop down

The example I posted addressed this. It works on Combo Boxes as well.

However, Good Luck With Your Project!
 
The example I posted addressed this. It works on Combo Boxes as well.

Oh, I see, you were suggesting that I take that particular function out of the example. I just looked at the sample and saw how it was being applied--as a filter for a continuous form.

Yes, that is exactly what I'm looking for, but looking at the code, I think it's too complicated for what I want to do. I'd have to do a lot of coding and experimenting (I get completely lost with strings, etc. in VBA) to make it work. So it's easier for me to use the Dropdown function, which is close enough for my purposes.

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom