Make a Combo Box non-editable (1 Viewer)

Local time
Yesterday, 23:05
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!!
 

Gasman

Enthusiastic Amateur
Local time
Today, 05:05
Joined
Sep 21, 2011
Messages
14,216
Look at the properties on the Data tab of the combo.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:05
Joined
Oct 29, 2018
Messages
21,446
Row Source Type = Value List
Row Source = "Business Value";"Business Budget"
Limit To List = Yes
 

Mike Krailo

Well-known member
Local time
Today, 00:05
Joined
Mar 28, 2020
Messages
1,036
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

Top Bottom