Solved

can you round down in access

Posted on 2010-11-29
4
487 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

919 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now