Sum problem

wrightie

Registered User.
Local time
Today, 15:26
Joined
Jun 11, 2009
Messages
22
I’m stumped on this one. I just don’t understand why it’s doing it. :confused:

I have a subform which is for inputting debits and credits. At the end of this subform I have two totals =Sum([Debit]) and =Sum([Credit]) which both work fine.
I then have a Grand Total =Sum([Debit]+[Credit]) which seems to work but on occasion it fails me. For instance the Grand Total should always equal zero (if it isn’t the user can’t move forward) but I have an instance where it displays zero which is correct but when the user tries to move on the it says the balance isn’t zero even though it’s showing zero. But when you click into the field it will display 1.13686837721616E-13

Does anyone have any idea what it could be?

I hope this is all making sense.

Wrightie
 
Have you got some formatting on the text box? FORMAT property.
 
Thought it was the Fix function but its not that ... damn

I have standard as the format in the Grand Total text box and decimal places 2

Cheers
 
Last edited:
What are the data types of Debit and Credit? I am presuming type Number?
 
Yeh in the table the credit and debit fields are set to Number ,
Field Size: Double
Format: Standard
Decimal Places: 2
 
Oh my god. What a fool I am.

Cheers for that vbaInet you've saved me a headache.
 
Sometimes all you need is a "nudge" in the right direction.

You should look up the Nz() function as well. It may come in handy in your calculations. :)

You're welcome.
 

Users who are viewing this thread

Back
Top Bottom