SUMM algebric value

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

SUMM algebric value

Post by sal21 »

Me.LDIFF.Caption = Format(Abs(Me.ListView1.ListItems(1).ListSubItems(2).Text - Me.ListView1.ListItems(1).ListSubItems(1).Text), "#,##0.00")

the value in item are the -136.560,55 and 136.560,55

Me.LDIFF.Caption = 273.121,10(?!)

the code summ insted to meke a difference!

peraphs resolved with:
dim SOMMA AS double
SOMMA = CDbl(Me.ListView1.ListItems(1).ListSubItems(1).Text) + CDbl(Me.ListView1.ListItems(1).ListSubItems(2).Text)
Me.LDIFF.Caption = Format(SOMMA, "#,##0.00")
Last edited by sal21 on 01 Mar 2014, 17:12, edited 1 time in total.

User avatar
HansV
Administrator
Posts: 78504
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SUMM algebric value

Post by HansV »

Me.ListView1.ListItems(1).ListSubItems(2).Text = -136.560,55
Me.ListView1.ListItems(1).ListSubItems(1).Text = 136.560,55
Me.ListView1.ListItems(1).ListSubItems(2).Text - Me.ListView1.ListItems(1).ListSubItems(1).Text = -136.560,55 - 136.560,55 = -273.121,10
Abs(Me.ListView1.ListItems(1).ListSubItems(2).Text - Me.ListView1.ListItems(1).ListSubItems(1).Text) = Abs(-273.121,10) = 273.121,10
Best wishes,
Hans