I have a listview that is filled with an sql query from temp Sql DB that is created from a program that run from textbox inputs, which writes this db. When the select button is pushed it query loads the listview. Sometimes their may be "0" or null values in at lest three columns. I have tried a Do until count of listview to do a remove() of the index where those 0 values appear in listview, but can not get it to work. Copy of code
Dim indexes As ListView.SelectedIndexCollection = OS_Form.ListView2.SelectedIndices
Dim index As Integer
Dim rcount As Integer
rcount = OS_Form.sh_listview2.Items.Count
For index = 1 To rcount
If index > rcount Then
Exit For
If OS_Form.sh_listview2.Items.Item(X).SubItems(3).Text = "0" Then
OS_Form.sh_listview2.Items(X).Remove()
End If
If OS_Form.sh_listview2.Items.Item(X).SubItems(6).Text > "10" Then
OS_Form.sh_listview2.Items(X).Remove()
End If
End If
Next
Any help please.