Limiting a Ccur() function to 2 decimal places

  • Thread starter Thread starter graeme34 via AccessMonster.com
  • Start date Start date
G

graeme34 via AccessMonster.com

Hello people, is there any way to cause the Ccur() function to round to two
decimal places??

As I have a query that has the InvoiceTotal expression,
InvoiceTotal: CCur([TotalNett]*([VatValue]/100+1))
When I view the expression in datasheet view it is formatted to two decimal
places, yet when I click into the cell the value expands to an extra decimal
place; therein lies the problem.
I am using this value in a recordset, I have a Do Until Loop...that counts
this field in the recordset then compares it with a value from a textbox
control containg the customer payment amount. The count in the loop counts
all records that have the invoice paid check box ticked. And if the textbox
control value is not equal to the count value of the recordset field value
the user is prompted with a message informing them that the amounts are
different.
When debugging the code I noticed the rs!InvoiceTotal was having the exact
value, i.e the extra decimal place.....is there anything I can add to the
Ccur() to limit it to two decimal places??
 
Sorry!! have just realised I have posted this question in the wrong section!
I meant to post it in the Modules/DAO/VBA section...not to worry I sure one
of you wise people will know the answer :)
graeme34 said:
Hello people, is there any way to cause the Ccur() function to round to two
decimal places??

As I have a query that has the InvoiceTotal expression,
InvoiceTotal: CCur([TotalNett]*([VatValue]/100+1))
When I view the expression in datasheet view it is formatted to two decimal
places, yet when I click into the cell the value expands to an extra decimal
place; therein lies the problem.
I am using this value in a recordset, I have a Do Until Loop...that counts
this field in the recordset then compares it with a value from a textbox
control containg the customer payment amount. The count in the loop counts
all records that have the invoice paid check box ticked. And if the textbox
control value is not equal to the count value of the recordset field value
the user is prompted with a message informing them that the amounts are
different.
When debugging the code I noticed the rs!InvoiceTotal was having the exact
value, i.e the extra decimal place.....is there anything I can add to the
Ccur() to limit it to two decimal places??
 
Back
Top