Checking for zero is not working

  • Thread starter Thread starter Warman
  • Start date Start date
W

Warman

I have a form that is accounting related. Several entries are made (plusses
and minuses) that must come back to zero before posting the record to the
table. When I enter whole dollar amounts, the check figure will work
(balance). When I enter numbers with one decimal place it also works. But, as
we all know, there is two decimals to work with in entering numbers (dollars
and cents). When I enter numbers with two decimal places, the balancing box
says 0.00 but my "check" routine pops up and says the entry does not balance
and I can not post the entries to my table.

Any help?

Thanks.
 
Warman said:
I have a form that is accounting related. Several entries are made (plusses
and minuses) that must come back to zero before posting the record to the
table. When I enter whole dollar amounts, the check figure will work
(balance). When I enter numbers with one decimal place it also works. But,
as
we all know, there is two decimals to work with in entering numbers
(dollars
and cents). When I enter numbers with two decimal places, the balancing
box
says 0.00 but my "check" routine pops up and says the entry does not
balance
and I can not post the entries to my table.


What data type are you using for the fields involved? The Currency data
type -- not to be confused with the "currency" *format* -- is a precise
decimal type, and shouldn't have this problem. But if your field types are
Single or Double, then they are imprecise floating-point values and
calculating with them can lead to very slight differences from what you'd
expect.
 
I put a "round" expression in the balance check field and that cured it.

Thanks for your help.
 
Back
Top