can anyone help me with the basic syntax to populate a multi-column listview
with data in Access 2002. I have a two column list view and am not sure how
to populate it.
I have a collection object which has a description value and a monatery
value associated with each item in the collection. I need to loop through
the collection but get error when trying to populate the list view. Here is
my code:
Dim item as ListItem
For i = 1 To MyCollection.Count
Set item = me.LstviewCtl.ListItems.Add(, , MyCollection(i).TransDesc)
item.SubItems(i) = MyCollection(i).Amount
Next i
My desired result:
Col 1 Col2
<desc> <Amt>
<desc> <Amt>
<desc> <Amt>
<desc> <Amt>
Thanks.
Douglas J. Steele - 20 Jun 2004 21:43 GMT
Rather than
item.SubItems(i) = MyCollection(i).Amount
it should be
item.SubItems(1) = MyCollection(i).Amount
Regardless of how many elements there are, you're always adding the first
subitem to each item.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> can anyone help me with the basic syntax to populate a multi-column listview
> with data in Access 2002. I have a two column list view and am not sure how
[quoted text clipped - 19 lines]
>
> Thanks.