Slight problem with ListView
Hello Everyone
I'm trying to use ListView to get contents of an Access Table into it...And I use the following code to do so...but while executing the statements I get an error- Invalid property Value
Please help!!!!
Dim Db As Database
Dim Rs As Recordset
Dim SQL As String
Dim MyItem As ListItem
Private Sub Form_Load()
Set Db = OpenDatabase("d:\check\taws\data.mdb")
SQL = "SELECT * FROM Audit "
Set Rs = Db.OpenRecordset(SQL, dbOpenDynaset)
Do While Not Rs.EOF
Set MyItem = ListView1.ListItems.Add(, , Rs(0))
MyItem.SubItems(1) = Rs(0)
MyItem.SubItems(2) = Rs(1)
'continue as above until all fields are accounted for
Rs.MoveNext
Loop
Rs.Close