Checking for zero is not working

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.
 
D

Dirk Goldgar

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.
 
W

Warman

I put a "round" expression in the balance check field and that cured it.

Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top