Control Source Format for rounding

G

Guest

I have a box that calculates discounts or allows me to enter a manual amount.
The control source for it is :=IIF([Discount]<=0, [ManDisc],
([DisTx]+[DisNTx])). The last 2 fields handle taxable and non-taxable
discounts. The fields (except for manual)are percentages. These work OK,
but I need it to round to only 2 decimal places. Now when it is stored in
the table, it sometimes has 3 decimal places which messes with the grand
total at the end of the day. Any suggestions?
Thanks!
 
J

John W. Vinson

I have a box that calculates discounts or allows me to enter a manual amount.
The control source for it is :=IIF([Discount]<=0, [ManDisc],
([DisTx]+[DisNTx])). The last 2 fields handle taxable and non-taxable
discounts. The fields (except for manual)are percentages. These work OK,
but I need it to round to only 2 decimal places. Now when it is stored in
the table, it sometimes has 3 decimal places which messes with the grand
total at the end of the day. Any suggestions?
Thanks!

Just use the built in Round function:

=IIF([Discount]<=0, [ManDisc],
Round([DisTx]+[DisNTx], 2)).

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

#Error on form 2
Rounding Question 3
Rounding problem 9
Rounding up a currency field 3
Calculated control not working, no error message 2
Rounding 2 decimal Places 1
Calculated Field in Form 6
Rounding 2

Top