Restricting combobox entry by user

GPSPOW

Registered User.
Local time
Today, 11:04
Joined
Apr 25, 2012
Messages
27
Hi,

I have an Excel workbook with a user entry combo box that uses the "add item" methodolgy to create a drop down list for the user to select a valid response. However, I have just learned that the users are able to free form type their responses. How can I restrict them to the add items?

Below is my code:

Private Sub UserForm_Initialize()
If IsDate(txtDOS.Text) Then
txtDOS.Text = Format(txtDOS, "MM/DD/YYYY")
End If
txtDenamtOldValue = "$0.00"
Me.txtDenamt = "$0.00"

With cmbReason
.AddItem "ABN"
.AddItem "ELIGIBILTY"
.AddItem "MISSED FILING DEADLINE"
.AddItem "AUTHORIZATION/PRECERT"
.AddItem "MEDICAL NECESSITY"
.AddItem "OTHER"
.AddItem "PROVIDER LIABLE"
.AddItem "UNAUTHORIZED"
.AddItem "UNDERPAID"

End With
cmbReason = ""
With cmbDept
.AddItem "CIC"
.AddItem "KG"
.AddItem "PAS"
.AddItem "PHS"
.AddItem "SIS"
.AddItem "RAD"
.AddItem "THI"
.AddItem "TCH"
.AddItem "UND"
End With
cmbDept = ""
With cmbUser
.AddItem "IMATA"
.AddItem "LSMITH"
.AddItem "MJONES"
.AddItem "KTRAINER"
.AddItem "MROCHA"
.AddItem "RBLACKMON"
.AddItem "TLUNDAY"
.AddItem "TSHANNON"
End With
cmbUser = ""
cmbReason.SetFocus
End Sub


Do I have to programmitcally restrict them or is is a property flag that needs to be set.


Thanks

GPSPOW
 
Hi GPSPOW,

Try going to the design view of the Userform >> click on the Combo Box object & go to the 'Locked' property of the Combo Box & change it to 'True'.

I haven't tested this with any values but it won't let me add any new value into the Combo Box with this Property set.

I'm using 2007 btw.

Hth.
 

Users who are viewing this thread

Back
Top Bottom