[求助]listview问题!
Dim i As Integer, j As IntegerDim lvWidth As Integer
lvWidth = ListView1.Width
'初始化LISTVIEW的某些属性
ListView1.View = lvwReport
ListView1.GridLines = True
ListView1.FullRowSelect = True
ListView1.ListItems.Clear
ListView1.ColumnHeaders.Clear
For i = 1 To 2 '初始化列内容,列宽
Set ColumnHeader = ListView1.ColumnHeaders.Add
ColumnHeader.Text = RsAddPOI.Fields(i).Name
ColumnHeader.Width = lvWidth / 2
Next
For j = 1 To RsAddPOI.RecordCount - 1
If RsAddPOI.EOF Then Exit For
Set ListItem = ListView1.ListItems.Add
ListItem.Text = RsAddPOI.Fields(1).Value
For i = 1 To 2
ListItem.SubItems(i) = RsAddPOI.Fields(i).Value ‘这里说无效的属性值
Next
RsAddPOI.MoveNext
Next
数据库里2个字段分别是IDNUM和NAME,有20多条记录,我想把纪录都显示在LISTVIEW里!