Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / June 2004

Tip: Looking for answers? Try searching our database.

Help with populating lsitview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ricky A. - 20 Jun 2004 20:22 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.