ItemsSelected is a collection of Variants!
From the Help file ----
Sub BoundData()
Dim frm As Form, ctl As Control
Dim varItm As Variant
Set frm = Forms!Contacts
Set ctl = frm!Names
For Each varItm In ctl.ItemsSelected
Debug.Print ctl.ItemData(varItm)
Next varItm
End Sub
The next example uses the same list box control, but prints the values of
each column for each selected row in the list box, instead of only the
values in the bound column.
Sub AllSelectedData()
Dim frm As Form, ctl As Control
Dim varItm As Variant, intI As Integer
Set frm = Forms!Contacts
Set ctl = frm!Names
For Each varItm In ctl.ItemsSelected
For intI = 0 To ctl.ColumnCount - 1
Debug.Print ctl.Column(intI, varItm)
Next intI
Debug.Print
Next varItm
End Sub
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1125 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:eR**************@TK2MSFTNGP12.phx.gbl...
Hi
I am using the following get the items from a multiselect list;
Dim ctl As Control
For Each ctl In Me.BatchInvoicesList.ItemsSelected
Problem is that I am getting a 'Object not found error'. Same with;
For Each ctl In Me!BatchInvoicesList.ItemsSelected
What am I doing wrong?
Thanks