save rounded value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a surcharge field which automatically calculates 3 percent of the
subtotal with the following calculation:

Me!Surcharge = (Me!SubTotal * Me!surchargePercent) / 100

This will give me a correct calculated answer.

My problem is, it displays a rounded number but saves a not rounded number
making for incorrect reports (the database is exported to a .dbf file for
further processing).

An example is:

79.8394
If that is the result of my calculation it will save as 79.8394, but will
display 79.84.

I have found, via searching this forum, that I can truncate the decimals to
79.8394 and keep it as currency type and it will not round, and it will only
save 79.83.

My client needs it to round to 79.84 and save the data as 79.84.

Thanks,
Johnie Karr
(e-mail address removed)
Data Management Technologies
www.datamt.org
 
Hi Johnie

Use the Round function:

Me!Surcharge = Round((Me!SubTotal * Me!surchargePercent) / 100, 2)
 
My client needs it to round to 79.84 and save the data as 79.84.

Ok, so round it:

Round(Me!Surcharge = (Me!SubTotal * Me!surchargePercent) / 100, 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

Back
Top