Avatar of isnoend2001
isnoend2001
Flag for United States of America asked on

vb6 displaying wrong calculation

Dim Credits As Long
lblCredit = 40
Credits = -20
lblCredit = Val(lblCredit) - (Credits)
lblCredit displays 60 instead of 20
The lblCredit is increased by 20, but should be reduced by 20
what is wrong ?
Visual Basic Classic

Avatar of undefined
Last Comment
isnoend2001

8/22/2022 - Mon
SOLUTION
Dan Craciun

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
isnoend2001

ASKER
this works lblCredit = Val(lblCredit) + (Credits)
ASKER CERTIFIED SOLUTION
aikimark

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
isnoend2001

ASKER
Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23