Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making a combo box uneditable

Status
Not open for further replies.

mnb098mnb

Programmer
Sep 10, 2001
2
GB
how do i make a combo box uneditable in VBA.
 
What do you mean by uneditable? Are you referring to the user typing in a value? If so, you should use a listbox rather than a combobox.
 
sorry! i was a bit unclear!

I'm using a CommandBarComboBox (on a command bar), can i make it uneditable..

i.e. so the user can't put text into it!

apologies again for my vagueness.

 
Hi!

Combo boxes have a Limit to List property which, if you set it to yes will not allow the user to put anything in the box except what is already in the list. Access will give the user an error message and will not let them out of the box unless they choose something from the list. There are a couple of other things you should know, first there is a property called Auto Expand which should be set to yes. This property will make Access search the list as the user is typing things in and will choose the first match to display. Also, there is a NotInList Event procedure which you can use to give your users your own error message if you prefer and you can also give them the chance to add to the list in that procedure if that seems advisable.

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top