Combo Box - Use Down Arrow for More Choices

lbnear

Registered User.
Local time
Today, 16:30
Joined
Apr 13, 2007
Messages
14
Can the combo box on a form be formatted (maybe by macro?) so that the user who is completing the input can use their down arrow when they are in the combo box to reveal all of the choices in the list? E.G. the user tabs to the new field, types "b" for black (and the word black appears), but they then can use the down arrow to see all of the remaining colors in the list, starting with black?
 
How about if you just put: Me.ComboBoxName.DropDown in the OnEnter event? Using your ComboBoxName of course.
 
Oh so close!!! Okay, so I tested your suggestion (thank you!); however, I don't want to always display the list... only if I don't like the choice I get when I enter the first letter. In other words, when I hit "b", if I don't want black (the first b word in my list) but blue (the second b word in my list), I can use my down arrow to see the list. If I did want black, it would pre-fill (as it does) but without showing me the whole list. Sorry for the long narrative!
 
Alright then, turn KeyPreview ON for your form and put the following in the KeyDown event of the ComboBox:
Code:
Private Sub cboName_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyDown Then
   Me.cboName.Dropdown
   KeyCode = 0 '-- Eat the first DownArrow key
End If

End Sub
Using your cboName of course.
 
i see what you mean

you can continue to refine the selection by continuing to type

ie

b = black
bl = black
blu = blue

but i cant see a keyboard method, of clicking the down arrow.
 
That's almost it! Okay, I entered your code (thank you again!), but I cannot scrole down using the arrow. My example is: I type "b" and get black, I use the down arrow, the list with blue comes up, but the down arrow ceases to work (I can't get to any of the other choices, without then using my mouse to click on the scroll bar).

Thank you for your help with this!
 
Gemma,
You're right. We should not eat the DownArrow key because it is then useless.
 
Gemma's idea works; however, the list (table) I'm using has over 100 entries. My users SHOULD know what project they're working on, but they usually don't and wouldn't think to enter the next key!

Thanks for your help guys!
 
Would teaching the user that while the cursor is within the combo, they could hold the ALT key down while they hit down arrow be something to consider?
 
Just get rid of the RED code.
Code:
Private Sub cboName_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyDown Then
   Me.cboName.Dropdown
[COLOR="Red"]'---   KeyCode = 0 '-- Eat the first DownArrow key[/COLOR]
End If

End Sub
 
Last edited:
RuralGuy,
Thank you very much! You've solved my problem - your last solution works like a charm.
 
Thank you! It worked for me in Access 2010 perfectly.
 
The archives strike again. Another satisfied customer. :D
 

Users who are viewing this thread

Back
Top Bottom