Public Function RndUpN(varIn As Variant, n As Variant) As Long
' Rounds anything up to increments of n
' Converts Nulls, Text, and Negative values to 0
' Arvin Meyer 9/17/1998
On Error Resume Next
If IsNumeric(varIn) Then
RndUpN = varIn \ n
RndUpN = RndUpN * n
If (varIn Mod n) > 0 Then
RndUpN = RndUpN + n
End If
Else
RndUpN = 0
End If
End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads: http://www.datastrat.com http://www.mvps.org/access
Put it into a Module; save the module with some name OTHER than the
name of the function (basRound maybe). You can then call the function
from a Query or in the control source of a textbox on a form or
report.
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.