Solved

can you round down in access

Posted on 2010-11-29
4
503 Views
Last Modified: 2012-06-27
Hi Experts,

I have some calculations i'm doing based on values of other fields.  In one calculation, i need to round down to the nearest tenth.  This is my code, it rounds up.  Is there a way to do this rounding down.  I need the value to be 1.8 not 1.9

me.txtPoundsPerPieceFt.Value=Round(me.txtCutLength.Value / 12, 1)

where me.txtCutLength value = 22.625

Thanks :-)
Laura
0
Comment
Question by:linbayzak
4 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 34233339
me.txtPoundsPerPieceFt.Value=Int(me.txtCutLength.Value / 1.2) / 10.0
0
 
LVL 13

Expert Comment

by:Rick
ID: 34233347
Use truncate instead of round
0
 

Author Closing Comment

by:linbayzak
ID: 34233377
thank you, works perfectly....now it didn't maintain my 10.0 on the end, just the 10, is that ok?  it did get the right number.  also, access didn't allow truncate to be used, sorry.  thanks again :-)

laura
0
 
LVL 10

Expert Comment

by:VTKegan
ID: 34233387
There are two good functions for this available in Excel.  You can use them by going to Tools -> References and add Microsoft Excel 12.0 Object Library and add these two functions to a module for your use.

Function RoundUp(arg1 As Double, arg2 As Double) As Double

RoundUp = Excel.WorksheetFunction.RoundUp(arg1, arg2)

End Function


Function RoundDown(arg1 As Double, arg2 As Double) As Double

RoundDown = Excel.WorksheetFunction.RoundDown(arg1, arg2)

End Function

Using RoundDown will give you exactly what you need.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question