0

I will not that the code below
shall count up or down

'********************************* Sumtax
  For lngIndex2 = 1 To ListView1.ListItems.Count
        lngTot2 = lngTot2 + ListView1.ListItems(lngIndex2).SubItems(5)
   Next
       Text10.Text = Format(lngTot2, "###0.00")

if I have say 83.67 in a listview
then in the text10.text shall
be the same amount no differens
text10.text = 83.67

2
Contributors
3
Replies
16
Views
2 Years
Discussion Span
Last Post by bonzo2008
0

Firstly, the syntax at line 2 & 3 are wrong. It synax would be

For lngIndex2 = 0 To ListView1.ListItems.Count-1
    lngTot2 = lngTot2 + Val(ListView1.Items(lngIndex2).SubItems(5).Text)
Next

More consizely, it should be

For lngIndex2 = 0 To ListView1.ListItems.Count-1
    lngTot2 += Val(ListView1.Items(lngIndex2).SubItems(5).Text)
Next

To show your result the code is

Text10.Text = Format(lngTot2, "0.00")

Edited by Shark_1

0

Hi

When I renove the + sign it works perfect

Thank's for the help

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.