Good Morning,
I am using Access '03 and SQL 2000 to create a program to calculate incentive pay for plant employees. Plant supervisors need to be able to group employees, so I have two list boxes one that displays a list of all employees in the following format: LASTNAME, FIRSTNAME, I have the following code to copy the selected values to another listbox:
When the items are copied, only the first name appears in the destination list box, why?
I am using Access '03 and SQL 2000 to create a program to calculate incentive pay for plant employees. Plant supervisors need to be able to group employees, so I have two list boxes one that displays a list of all employees in the following format: LASTNAME, FIRSTNAME, I have the following code to copy the selected values to another listbox:
Code:
Public Sub CopySelected(ByRef frm As Form)
Dim ctrlSource As Control
Dim ctlDest As Control
Dim strItems As String
Dim intCurrentRow As Integer
Set ctrlSource = [Form_List Box Example]!List1
Set ctlDest = [Form_List Box Example]!List2
For intCurrentRow = 0 To ctrlSource.ListCount - 1
If ctrlSource.Selected(intCurrentRow) Then
strItems = strItems & ctrlSource.Column(1, _
intCurrentRow) & ";"
End If
Next intCurrentRow
'Reset destination controls' RowSource property.
ctlDest.RowSource = ""
ctlDest.RowSource = strItems
Set ctrlSource = Nothing
Set ctlDest = Nothing
End Sub