Calculation error

CEH

Curtis
Local time
Today, 11:16
Joined
Oct 22, 2004
Messages
1,187
Having a problem with results on a form. Three unbound text boxes. One called "BillableDays" second called "DailyAmount" and third "PartialInvoice"
Now "PartialInvoice" is a result of [BillableDays]*[DailyAmount]
But........ The figures are not correct.
For example.... [BillableDays] = 7 ... [DailyAmount] = $135.42 and the result in [PartialInvoice] is $947.91 ...........
Any thoughts on why this is happening and how to correct??
 
... in the 3rd unbound text box all you have is:
=[BillableDays]x[DailyAmount]

???

I'm unable to reproduce this issue.

QT
 
Yes.... Control source of [PartialInvoice] is =[BillableDays]*[DailyAmount]
[BillableDays] and [DailyAmount] are also based on calculations.
 
I'd guess that DailyAmount doesn't contain what you think it does. If it's based on a calculation, make sure that calculation is rounding to 2 digits. My guess is that while you're seeing $135.42, it's actually carrying more digits, like $135.41625.
 
I think I've checked everything to make sure decimals are set at 2. Have a look...........
 

Attachments

The settings on the format tab control what is displayed; they have NO effect on the actual calculation. This calculation can and will produce a result with more than 2 digits:

=([txtMonthlyInvoice]*12)/[txtDaysYearly]

Put in a msgbox on it

MsgBox Me.txtDailyAmount

and I think you'll see that what it holds is not what you see. I did. I don't know your whole process, but at the appropriate point(s), and maybe it's the calculation above, wrap the calculation in the Round() function to make sure it's rounding to 2 digits.
 
Thanks Paul,
After making this change..... =Round(([txtMonthlyInvoice]*12)/[txtDaysYearly],2)
Works fine..... And calculates correctly.

Thanks again
Curtis
 

Users who are viewing this thread

Back
Top Bottom