B
BaBaBo
Dear All:
I have a combo box on a form.
I have set up code to populate the list on the combo box as follows:
Private Sub Form_Load()
cmbFirstName.AddItem "David"
End Sub
Then there is a command button that you can use to add other names to the
list.
Private Sub cmdAddFirstName_Click()
Dim iCounter As Integer
If Me.txtInput.Value = "" Then Exit Sub Else 'Checks to see if nothing in
the text box.
For iCounter = 0 To (FirstName.ListCount - 1)
If FirstName.ItemData(iCounter) = txtInput.Value Then
MsgBox "Duplicate item. Can't add item."
Exit Sub 'Duplicate was found.
What I want to do is add code that will automatically add the code:
cmbFirstName.AddItem "New Name"
to the forms code for each new name added to the combo box.
Thanks in advance all.
The combo box is not bound to a table to get
I have a combo box on a form.
I have set up code to populate the list on the combo box as follows:
Private Sub Form_Load()
cmbFirstName.AddItem "David"
End Sub
Then there is a command button that you can use to add other names to the
list.
Private Sub cmdAddFirstName_Click()
Dim iCounter As Integer
If Me.txtInput.Value = "" Then Exit Sub Else 'Checks to see if nothing in
the text box.
For iCounter = 0 To (FirstName.ListCount - 1)
If FirstName.ItemData(iCounter) = txtInput.Value Then
MsgBox "Duplicate item. Can't add item."
Exit Sub 'Duplicate was found.
What I want to do is add code that will automatically add the code:
cmbFirstName.AddItem "New Name"
to the forms code for each new name added to the combo box.
Thanks in advance all.
The combo box is not bound to a table to get