Combobox Not Editable

  • Thread starter Thread starter Scott Viney
  • Start date Start date
S

Scott Viney

Hi All,

How can I make a combo box to be so that it cant have other values added?

I already have all the values I want the users to select from. I dont want
them typing in new ones.

Have a good one,
Scott V
 
Scott Viney said:
Hi All,

How can I make a combo box to be so that it cant have other values
added?

I already have all the values I want the users to select from. I dont
want them typing in new ones.

Have a good one,
Scott V

Hi Scott,

Set the ComboBox's "Limit to List" to YES and put the following code in
the NotInList event.

--- Warning - AirCode (untested) ---

Private Sub ComboBox_NotInList(NewData As String, Response As Integer)

Response = MsgBox("[" & NewData & "] is not a valid selection..." & _
vbCr & vbCr & _
"You must pick from the existing selections!", _
vbOKOnly + vbInformation, "Incorrect selection")

Response = acDataErrContinue

End Sub

--- End AirCode ---

You will need to change "ComboBox" to the name of your control!

hth
 
Back
Top