Adding Decimals display wrong value (1 Viewer)

WineSnob

Not Bright but TENACIOUS
Local time
Today, 01:35
Joined
Aug 9, 2010
Messages
211
I have 2 controls on a form cmbFed and cmbState both are formatted as fixed with decimal places as 2. They display the correct values.​
cmbFed = .18​
cmbState = .06​
When I add a new control to add the 2.​
=[cmbFed]+[cmbState] result is .18.06​
instead of .24​
It looks like it is treating them as text.​
I even tried to do it in code​
Me.text639 = Me.cmbFed + Me.cmbState with the same results.​
It must be something simple I am missing a format for text639 or ?????​
Thanks.​
 

Minty

AWF VIP
Local time
Today, 06:35
Joined
Jul 26, 2013
Messages
10,371
try Clng(cmbFed) + Clng(cmbState)
And yes it is treating them as text if you get those results.
 

WineSnob

Not Bright but TENACIOUS
Local time
Today, 01:35
Joined
Aug 9, 2010
Messages
211
That produces the result 0 and it is justified left like text.
 

WineSnob

Not Bright but TENACIOUS
Local time
Today, 01:35
Joined
Aug 9, 2010
Messages
211
That did it. Thanks to Minty and JHB.
 

Minty

AWF VIP
Local time
Today, 06:35
Joined
Jul 26, 2013
Messages
10,371
Oops - yes sorry - less haste more speed...
 

Users who are viewing this thread

Top Bottom