'just change the items form the rnd to rs!fields
Code:
Dim l As Long
Dim dblRnd As Double
Dim dteRnd As Date
With ListView1
' Add three columns to the list - one for each data type.
' Note that the data type is set in the column header's
' tag in each case
'
.ColumnHeaders.Add(, , "String").Tag = "STRING"
.ColumnHeaders.Add(, , "Number").Tag = "NUMBER"
.ColumnHeaders.Add(, , "Date").Tag = "DATE"
'
' Set the column alignment - has no bearing on the sorts.
'
.ColumnHeaders(1).Alignment = lvwColumnLeft
.ColumnHeaders(2).Alignment = lvwColumnRight
.ColumnHeaders(3).Alignment = lvwColumnCenter
'
' Set BorderStyle property.
ListView1.BorderStyle = ccFixedSingle
'
' Set View property to Report.
ListView1.View = lvwReport
'
' Populate the list with data
With .ListItems
For l = 1 To 100
With .Add(, , "ListItem " & Format(l, "0000"))
dblRnd = (Rnd() * 10000) - 5000
dteRnd = (Rnd() * 1000) + Date
.ListSubItems.Add , , Format(dblRnd, "0.00")
.ListSubItems.Add , , Format(dteRnd, _
"dd/mm/yyyy")
End With
Next l
End With
End With
'