I use this code and it works great!
Function RoundToNearest(dblNumber As Currency, varRoundAmount As Double, Optional varUp As Variant) As Double
Dim dblTemp As Double
Dim intTemp As Integer
I use this, which will round to any number of decimal places:
Code:
Public Function MyRound(YourNumber As Double, Places As Integer) As Double
MyRound = YourNumber * (10 ^ Places)
MyRound = MyRound + 0.5
MyRound = Int(MyRound)
MyRound = MyRound / (10 ^ Places)
End Function
You might be asking why in stages like that, instead of doing it using a single expression, but if you do, because of the way that Access stores floating point numbers internally, it will occasionally round the wrong way, doing the operation in stages overcomes this.