Solved

can you round down in access

Posted on 2010-11-29
4
485 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

746 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

12 Experts available now in Live!

Get 1:1 Help Now