I am working with a multi select list box in access. The code is:
Sub MoveToCustomer2 ()
Dim frm As Form, Ctl As Control
Dim varItem As Variant
Set frm = Forms!frmResolv eCustomers
Set Ctl = frm!lstUnassign ed
For Each varItem In Ctl.ItemsSelect ed
Debug.Print varItem
Debug.Print Ctl.Column(0)
Next varItem
End Sub
If I select items 2, 3, 6and 8 the program prints 1,2,5,7 which is correct
(zero based)but for
ctl.Column(0) it prints the value of the first selectedItems for each of the
4 selected records.
They should all be different.
Is the reference to the column wrong?
Thx
Kevin
Sub MoveToCustomer2 ()
Dim frm As Form, Ctl As Control
Dim varItem As Variant
Set frm = Forms!frmResolv eCustomers
Set Ctl = frm!lstUnassign ed
For Each varItem In Ctl.ItemsSelect ed
Debug.Print varItem
Debug.Print Ctl.Column(0)
Next varItem
End Sub
If I select items 2, 3, 6and 8 the program prints 1,2,5,7 which is correct
(zero based)but for
ctl.Column(0) it prints the value of the first selectedItems for each of the
4 selected records.
They should all be different.
Is the reference to the column wrong?
Thx
Kevin
Comment