The following code sum my lines in a dataset.
'Energy 1776
Public Shared MMBTU76 as Integer=0
Public Shared Function GetMMBTU76(Item as Integer) as Integer
MMBTU76= MMBTU76 + Item
return Item/1000
End Function
Public Shared Function MMBTUTotal76()
return MMBTU76/1000
End Function
Public Shared PDMMBTU76 as Integer=0
Public Shared Function GetPDMMBTU76(Item as Integer) as Integer
PDMMBTU76= PDMMBTU76 + Item
return Item/1000
End Function
Public Shared Function PDMMBTUTotal76()
return PDMMBTU76/1000
End Function
When I do an autorefresh or refresh page, the code gets run again and again. This keeps adding up the numbers. I have tried to reset to zero, but with no luck. That would be the MMBTU76 and PDMMBTU76 that I'm returning to screen.Would like suggestion on how I can reset to zero when code runs a again.