Numbers are not adding up (1 Viewer)

micks55

Registered User.
Local time
Today, 14:57
Joined
Mar 20, 2006
Messages
110
Hi,
I have two combos with a cost price in Column(2) where the underlying table has a field called fldCost (Number, Single, Auto).
After selecting from both combos, cboF1 has 3.11 in column2 and cboF2 has 10 in column2. (eg: £3.11 and £10.00).
I'm trying to add the value from both combos in an unbound text box on the form set to Fixed, 2 decimals with the ControlSource =Nz([cboF1.Column(2)])+Nz([cboF2.Column(2)]).

The result I'm getting is 3.1110 and not 13.11 as it should be.

I've tried setting everything to currency but it makes no difference.
I've tried individual unbound boxes to get one result at a time then another to add them but that gives the same result.

Thanks in advance, it's driving me insane.
 

namliam

The Mailman - AWF VIP
Local time
Today, 15:57
Joined
Aug 11, 2003
Messages
11,695
it is because your fields are being treated as text instead of numbers, try wrapping a CDBL() around them
 

micks55

Registered User.
Local time
Today, 14:57
Joined
Mar 20, 2006
Messages
110
Many thanks, I now have
=CDbl(Nz([FspeciesCost]))+CDbl(Nz([CoreCost])) and all is well.
 

Users who are viewing this thread

Top Bottom