Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

Don't want Access to round numbers to nearest integer.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aaron - 16 Mar 2007 16:14 GMT
I am building some tables and forms in Access, and my numeric fields are
rounding to the nearest integer. I have the table field defined as a Numeric
and Auto for decimal places. I have the text box on the form defined as a
fixed with two decimal places. However, if I type in 2.3453 it will round it
to 2.00 or if I enter 3.5 it rounds it to 4.00. How do I get the text box to
leave the value to accurately round the number to whatever decimal place I
have defined for the field?
Dirk Goldgar - 16 Mar 2007 16:28 GMT
> I am building some tables and forms in Access, and my numeric fields
> are rounding to the nearest integer. I have the table field defined
[quoted text clipped - 4 lines]
> round the number to whatever decimal place I have defined for the
> field?

It sounds like the Field Size you've chosen for your field is Integer,
Long Integer, or Byte.  These are all whole-number data types, and can't
hold decimal places no matter what format you pick.  Change the field to
Single, Double, Currency, or Decimal, as appropriate for your use.
Single and Double are both floating-point types, which means they store
an imprecise representation of numbers, but their precision is high
enough for most purposes.  If you need absolute precision to a certain
number of decimal places, you can use the Decimal type, but Access has
historically had a few quirks in handling fields of this type and I'm
not sure what the current status of the Decimal data type is.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.