Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding in Access

Status
Not open for further replies.

terpster

MIS
Mar 18, 2002
26
0
0
US
How would you go about rounding to the thousands place in access? eg. 3600 -> 4000.

Thanks for your suggestions!
 
Probably best to set up your own procedure here.....

Question? Are you wanting to round anything <= 3499 to 3000 and anything >= 3500 to 4000????? Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Here you go then....put this in a public module and it as necessary...

Me![RoundedField] = RoundToThousands(Me![UnroundedNumber])

Or something such.....Let me know if you need more help

''''''''''''' Start Code '''''''''''''

Public Function RoundToThousands(intNumber As Integer) As Integer

' Created by Robert Johnson III (mstrmage1768)
' for terpster on 10/02/02 Tek-Tips thread181-372668

Select Case Right(intNumber, 3)
Case 0 To 499
RoundToThousands = intNumber - Right(intNumber, 3)
Case 500 To 999
RoundToThousands = (intNumber - Right(intNumber, 3)) + 1000
End Select

End Function

''''''''''''' End Code '''''''''''''''''
Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top