[求助]listview显示特殊条件的记录
Sub LVShow()
Call iSQL
Dim i As Integer
Do
For i = 1 To Rs.RecordCount
With lvDetails
If OptMetro.Value = True Then
If Rs!Property = "地铁站点" Then
.ListItems.Add , , Rs!idnum
.ListItems(i).ListSubItems.Add , , Rs!sname
End If
Else
If Rs!Property = "公交站点" Then
.ListItems.Add , , Rs!idnum
.ListItems(i).ListSubItems.Add , , Rs!sname
End If
End If
End With
Rs.MoveNext
Next i
Loop While Rs.EOF = False
Rs.Close
Set Rs = Nothing
Exit Sub
End Sub
我这样写为什么不行?说索引超出边界!