The solution to the above mentioned problem is as follows. I did get it some where from the net, probably Microsoft, but don't remember correctly.<br> <br>The Format property of a control can round a Number or Currency field to the number of decimal places that you want. However, this does not change the underlying data, which may contain additional digits that the control does not display. If you add the values in this control, the sum is based on the actual values and not on the displayed values. This may make the total seem inaccurate. <br> <br>This article shows you how to create four user-defined functions to round or truncate data to two decimal places so that the displayed and formatted value and the actual numeric or currency data are the same. <br> <br>This article assumes that you are familiar with Visual Basic for Applications and with<br>creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual. <br> <br>NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access versions 1.x and 2.0. For more information about Access Basic, please refer to the "Introduction to Programming" manual in Microsoft Access version 1.x or the "Building Applications" manual in Microsoft Access version 2.0 <br> <br> <br>MORE INFORMATION<br> <br>The functions are presented in two styles. The first style is appropriate for the AfterUpdate property of a form control to ensure that the data entered matches the data that is displayed. The second style is for use in expressions and calculated controls. <br> <br>To round or truncate numbers to two decimal places, create a new module and add the following functions. <br> <br>'******************************************************<br>' Declarations section of the module<br>'******************************************************<br> <br>Option Explicit<br>Const Factor = 100<br> <br>'=====================================================<br>' RoundAU and TruncAU are designed to be added to the<br>' AfterUpdate property on a form control.<br>'=====================================================<br>Function RoundAU(X As Control)<br> <br>X = Int(X * Factor + .5) / Factor<br> <br>End Function<br> <br>Function TruncAU(X As Control)<br>X = Int(X * Factor) / Factor<br>End Function<br> <br>'=====================================================<br>' RoundCC and TruncCC are designed to be used in<br>' expressions and calculated controls on forms and reports.<br>'=====================================================<br>Function RoundCC(X)<br> <br>RoundCC = Int (X * Factor + 0.5) / Factor<br> <br>End Function<br> <br>Function TruncCC(X)<br>TruncCC = Int (X * Factor) / Factor<br>End Function <br> <br>Examples of Using the Round and Truncate Functions<br> <br>The following examples use the sample database Northwind.mdb (or NWIND.MDB in version<br>2.0 or earlier). <br> <br>CAUTION: Following the steps in these examples will modify the sample database<br>Northwind.mdb (or NWIND.MDB in version 2.0 or earlier). You may want to back up the<br>Northwind.mdb (or NWIND.MDB) file and perform these steps on a copy of the database. <br> <br>Example 1<br> <br>Use the TruncAU() function to the AfterUpdate property of a form: <br> <br>1.Open the sample database Northwind.mdb. <br> <br>2.Create a new module called Rounding, and type the procedures in the preceding<br>section. <br> <br>3.Open the Products form in Design view, and add the TruncAU() function to the<br>AfterUpdate property of the UnitPrice field (or Unit Price field in version 2.0 or<br>earlier): <br> <br>Form: Products<br>--------------<br>Control Name: Unit Price<br>AfterUpdate: =TruncAU([UnitPrice]) <br> <br>If a user accidentally enters $23.055 instead of $23.05, the TruncAu() function<br>catches the mistake and changes the value to $23.05. If you use the RoundAu()<br>function instead, the function changes the value to $23.06. If you use neither<br>function, the value is displayed as $23.06, but the entered value, $23.055, is used in<br>any calculations. <br> <br>Example 2<br> <br>Use the RoundCC() function with an expression in a report's group footer. This example<br>assumes that you have already created the Rounding module in step 2 of Example 1: <br> <br>1.Open the sample database Northwind.mdb. <br> <br>2.Open the Summary Of Sales By Year report in Design view and use the RoundCC()<br>function in the ControlSource property of two controls in the report's group footer: <br>In Microsoft Access 7.0 and 97: <br> <br>Report: Summary of Sales By Year<br>--------------------------------<br>Control Name: QuarterSales<br>ControlSource: =Sum(RoundCC([SubTotal]))<br> <br>Control Name: YearTotal<br>ControlSource: =Sum(RoundCC([SubTotal])) <br> <br>In Microsoft Access 1.x and 2.0: <br> <br>Report: Summary of Sales By Year<br>--------------------------------<br>Control Name: Total Sales for Quarter<br>ControlSource: =Sum(RoundCC([Order Amount]))<br> <br>Control Name: Total Sales for Year<br>ControlSource: =Sum(RoundCC([Order Amount])) <br> <br>If you use RoundCC(), the report sums the values displayed in the report, even<br>though the actual values may contain hidden digits. <br> <br>NOTE: To change the number of decimal places that the functions use, open the Rounding<br>module in Design view and change the value of the global constant, Factor, as follows: <br> <br>10 = 1 decimal place<br>100 = 2 decimal places<br>1000 = 3 decimal places, and so on <br> <br>Limitations<br> <br>These functions should only be used with Currency data. If used with Double or Single<br>numbers, you may still receive minor rounding errors. The reason for this is that Single and<br>Double numbers are floating point. They cannot store an exact binary representation of<br>decimal fractions. Therefore there will always be some error. However, Currency values are<br>scaled integers and can store an exact binary representation of fractions to 4 decimal<br>places.