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!
Rick Brandt - 23 Mar 2008 17:48 GMT
> 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.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Wendy - 23 Mar 2008 19:04 GMT
Hi,
Have you tried setting the property - "Limit to List" = YES
Wendy
> 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!
Linq Adams - 23 Mar 2008 23:57 GMT
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.

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003