-
Hi Everyone,
I currently have a ListView control with three columns in it (Subtract, Add, Total). Is what I need to do is this, for every item in the ListView I either need to subtract the amount from the Total or I need to add the amount to the Total. Any ideas on how to do this inside of the ListView control. I would appreicate any help. Thank you.
-
Hey Ace,
Give this a try... this assumes that you have a value in Total and then either a value in Add or a value in Substract.
Code:
Dim intIndex as Integer
Dim intCount as Integer
'// Assuming lvwListView is your listview control
intCount = lvwListView.ListItems.Count
For intIndex = 1 to intCount
'// Assuming .Text = Total, .SubItems(1) = Add, .SubItems(2) = Substract
With lvwListView.ListItems(intIndex)
.Text = Cstr(Val(.Text) + Val(.SubItems(1)) - Val(.SubItems(2)))
End With
Next