austin350s10
Active Member
- Joined
- Jul 30, 2010
- Messages
- 321
I have a UserForm I am working on where the user is to make a selection from a dropdown style combo box. The problem I am having is I only want the user to be able to make a selection from the dropdown and not input there own value. I have set the property: Match Required to True.
Right now the user can input there own value but it returns the error MsgBox "Invalid Property Value". If the value there entered is not in the dropdown list.
Is there a way to intercept this error code and use my one error message or a way to block the user from adding there own values into the combo box?
Here is the only code I use to populate the combobox:
Right now the user can input there own value but it returns the error MsgBox "Invalid Property Value". If the value there entered is not in the dropdown list.
Is there a way to intercept this error code and use my one error message or a way to block the user from adding there own values into the combo box?
Here is the only code I use to populate the combobox:
Code:
Private Sub UserForm_Initialize()
Dim lMonth As Long
For lMonth = 1 To 12
Me.ComboBox1.AddItem Format(DateSerial(2000, lMonth, 1), "MMMM")
Next lMonth
End Sub