G
GoCoogs
I have a combobox that contains a list of all employees and an empty
listbox. I want the user to be able to add employees to the listbox by
selecting them in the combo box and pressing a button. I have found a
work around the get the employee's name but not their employee ID,
which is a hidden column in the combo box. Is there a simple way to
copy the selected combo box item to the listbox?
Private Sub btnAdd_Click()
If Me.cboStaff.Value = 0 Then
MsgBox ("Please select a staff member")
Else
Me.cboStaff.SetFocus
strcbotext = Me.cboStaff.Text
Me.lstStaff.AddItem (strcbotext)
End If
End Sub
Thanks,
Blake
listbox. I want the user to be able to add employees to the listbox by
selecting them in the combo box and pressing a button. I have found a
work around the get the employee's name but not their employee ID,
which is a hidden column in the combo box. Is there a simple way to
copy the selected combo box item to the listbox?
Private Sub btnAdd_Click()
If Me.cboStaff.Value = 0 Then
MsgBox ("Please select a staff member")
Else
Me.cboStaff.SetFocus
strcbotext = Me.cboStaff.Text
Me.lstStaff.AddItem (strcbotext)
End If
End Sub
Thanks,
Blake