General discussion

Locked

Access 97/2000 Presision for Currency

By nicholasP ·
I have a form, with two subforms on it.

The on subform has the detailed data, the other adds up one column from the detail. If the sum is not zero an error will pop up.

The detailed data is currency.

The data is saved as a Double with Two decimal spaces. For some reason it does not like the number 139,211.48
When I type this number in the subform does not add up to zero, even though it should

ant ideas?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97/2000 Presision for Currency

by Bob Sellman In reply to Access 97/2000 Presision ...

How are you adding the data? I don't know why that number might be a problem, but for your addition I would suggest that as part of the addition process you round each number in your code BEFORE adding it. In fact, for real accuracy, in your code multiply each number by 100, make it a long integer, add together, and do your comparison (with the sum handled the same way in your code).

I suggest this, especially using long integers for your "behind the scenes" calculations because double precision still carries "junk" along with what you entered (because binary cannot accurately represent some decimal numbers). Going to long integers within your calculations lets you eliminate this problem.

Unfortunately, Access does not, to my knowledge, offer what used to be called "decminal coded binary" numbers, which is a way of accurately representing decimal numbers with binary code.

Collapse -

Access 97/2000 Presision for Currency

by nicholasP In reply to Access 97/2000 Presision ...

I was not using a currency field.... thanks

Collapse -

Access 97/2000 Presision for Currency

by nicholasP In reply to Access 97/2000 Presision ...

This question was closed by the author

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums