list view question/problem **** Resolved *******
Hello I have a Form that has a bunch of controls a couple of textboxes, comboboxes and some cmd buttons with a listview
now what I am doing is gathering some user data via text boxes and combobox and I am giving the user the ability to add and remove these records into the list view only problem is one of those fields is a decimal field and I need to keep track of that number (that is not the problem) my problem is when the user
removes an item from the listview. I need to get the selected items .subitem and add it back to my running total I know you can go in and get the selected items from the listview however I just need the .subitems
Thanks
Okay listview Error specified arg was out of range of valid values
Here is the code
Private Sub Delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Delete.Click
Dim a As Integer
Dim lstItems As New ListViewItem()
For a = ListView1.Items.Count - 1 To 1 Step -1
If ListView1.Items(a).Checked = True Then
ListView1.Items.RemoveAt(a)
'
lstItems = ListView1.SelectedItems(a)
MsgBox(lstItems.SubItems(0).Text)
MsgBox(lstItems.SubItems(1).Text)
End If
Next
AddItem.Enabled = True
ListView1.Enabled = True
tempmoney = 0
labelcapture = tempmoney + Val(Label12.Text)
AddItem.Enabled = True
cboAcctNum.Focus()
End Sub
Thanks