What is a combobox that cannot be typed in

D

DF.thangld

Hey, anybody know about a combobox that cannot be typed in but can be
changed SelectedIndex? I mean, user can choose the item, but cannot type in
the combobox itself? I don't remember its name. And can you give me some
sample about how to use it. Thanks a lot!
 
R

Rick Brandt

DF.thangld said:
Hey, anybody know about a combobox that cannot be typed in but can be
changed SelectedIndex? I mean, user can choose the item, but cannot
type in the combobox itself? I don't remember its name. And can you
give me some sample about how to use it. Thanks a lot!

There is no such animal in Access.

You can use a ListBox (which providesno place to type), but that does not
drop down like a ComboBox.

You can set up a ComboBox so that the user must type an entry that matches
one that is in the list, but you cannot disallow typing completely.
 
L

Linq Adams via AccessMonster.com

In the form Design View, select the combobox and goto Properties - Event and
click in the box for OnKeyDown. When the ellipsis shows up, click on it,
click on Build Code then use this code:

Private Sub YourComboBox_KeyDown(KeyCode As Integer, Shift As Integer)
KeyCode = 0
End Sub

Now nothing will happen when the user presses any key.

BTW, setting "Limit to List" to YES doesn't prevent typing in the combobox,
it merely pops up an error message when the typed data doesn't match an item
in the box.
 
Top