Ricky A. said:
can anyone help me with the basic syntax to populate a multi-column list
with data in Access 2002.
Thanks.
You can adapt this code to your needs
======================
' Reset ListView Control and prepare column headers
Me!ListView.ListItems.Clear
With Me!ListView.ColumnHeaders
.Clear
.Add , , "Num.", 280
.Add , , "Type", 800
.Add , , "Note", 400, lvwColumnCenter
End With
' Create SQL statement used to fill recordset
strSQL = "SELECT * FROM <YouTableOrQuery>;"
Set rs = db.OpenRecordset(strSQL)
' Populate the data
If Err = conErrNoRecord Then
With Me!ListView.ColumnHeaders
.Clear
.Add , , "Records = None", 3600
End With
Set itmAdd = ListView.ListItems.Add()
itmAdd.Text = "No Record!"
Exit Sub
End If
While Not rs.EOF
Set itmAdd = ListView.ListItems.Add()
itmAdd.Text = rs!NUM
itmAdd.SubItems(1) = rs!Type
itmAdd.SubItems(2) = rs!Note
rs.MoveNext
Wend
====================
You need also to setup a reference to the Microsoft Windwos Common Controls
5.X (comctl32.ocx)
Sidnei Cordeiro