[AccessD] Strange results with simple calculation on a form

Bert-Jan Brinkhuis thevigil at kabelfoon.nl
Wed Mar 17 17:02:29 CST 2004


Hi all,

i was forced to unsubscribe a while ago because i couldn't keep up with you
and all the messages... ;-)

But today a strange thing happened i had to ask you all about. I didn't do a
big search on the internet, but searched the accessd archives and didn't
find it. It maybe is a well known problem, but here it goes.....

I have an unbound form where users will type amounts. All the txtboxes'
format are set to "standard" and the decimal places is set to 2. And i check
on the before_update event of these txtboxes if there are more then 2
decimals, if so, cancel = true. There is an calculated total control
(txtTotal) wich has a controlsource like =[txtbox1]+[txtbox2] and so on (in
total 12 txtboxes)
These txtboxes are used to 'split up' the amount in another txtbox.
(txtAmount)

Before saving i check if txtAmount = txtTotal. When no decimals are used
there is no problem, if there are only used decimals in 1 txtbox there is no
problem. But if there are used decimals in more txtboxes access will tell me
the values are not the same..... although the same values are shown... it
turns out there is a difference of: 0.00000000000000710542735!!!!!!
(debug.print told me this!)

When i use the same 'function' in VBA it works fine with the same
values....????

So it is not a real problem, but it IS something strange... wel to me it
is....

Thanks in advance.

Hope to keep up with you this time... ;-)

Bert-Jan




More information about the AccessD mailing list