Make a Combo Box non-editable

Local time
Today, 13:44
Joined
Jun 3, 2022
Messages
38
Hello! I would like to create a combo box within a form that is non-editable. Only the user can select the two options and not be able to enter any other value or text into it and hit save.

For example, combobox has two values
1. Business Value
2. Business Budget

I want the user to select only those two options in the combobox within the form and nothing else nor enter any made up information. Would appreciate the help!

Thanks!!
 
Look at the properties on the Data tab of the combo.
 
Row Source Type = Value List
Row Source = "Business Value";"Business Budget"
Limit To List = Yes
 
If allowedits is false, you will need to temporarily set it to true in the GotFocus event and then set to false again in the LostFocus event. This does not allow the user to edit the combo box, just change the value of it.

Code:
Private Sub cboBusiness_GotFocus()
   Me.AllowEdits = True
End Sub

Private Sub cboBusiness_LostFocus()
   Me.AllowEdits = False
End Sub
 

Users who are viewing this thread

Back
Top Bottom