2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by selvaganapathy
0

Hi
Change ListView.View to Report
Add Columns as per the recordset columns
Use ListView.ListItems.Add() method to add an item to ListView. It will return a ListItem object. Then use that object to add subitems

Ex

Dim oListItem    As ListItem

   ' Create two columns
   ListView1.ColumnHeaders.Add , , "First"
   ListView1.ColumnHeaders.Add , , "Second"
   ' Create a row
   Set oListItem = ListView1.ListItems.Add(, , "First Column")
   ' Add sub items
   oListItem.SubItems(1) = "Second Column"

Iterate thru all the records and show it in ListView

0

in the first column what should i put? example i want to put a data in my access how can i do that?

0

In the first column u should put the data from the recordset's first column. I have given the sample code only

To do

Open the Database Connection
Open the Recordset
Move to the first record

Do While Not Recordset.EOF
' Here populate the listview from recordset
'Ex Set oListItem = ListView1.ListItems.Add(, , Recordset.Fields("FieldName"))

Move to next record
Loop

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.