The following code should help you. It loops through a recordset and adds the information to a list view
Dim OneLine As ListItem
While Not RS.EOF
Set OneLine = lvwName.ListItems.Add
With OneLine
.Text = RS.fields(0).value
.SubItems(1) = RS.fields(1).value
.SubItems(2) = RS.fields(2).value
.SubItems(3) = RS.fields(3).value
.SubItems(4) = RS.fields(4).value
.SubItems(5) = RS.fields(5).value
.SubItems(6) = RS.fields(6).value
End With
RS.movenext
wend
The above function returns a ListItem object which is the item you have just added. Within this object there is a collection of ListSubItems which has an add method to add new items: thus-
dim objXXX as Listitem
set objXXX = lvFunctions.ListItems.Add intIndex, , prsData!FunctionCode
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.