Results 1 to 5 of 5
  1. #1
    Johanb26 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    25

    Access data type help

    Hi guys,

    In our database we have a few fields with number as the data type. But the values entered range between 0.001 - 0.200 when we enter this in our database for example 0.080 access automatically trims the value to 0.



    The field size we use is Double with decimal places as 4. I have also updated the database and changed the field size to decimal with 4 decimal places as well and we still get the same result.

    Is there a way to overcome this and what happened to all the data that have been inserted that have now been changed to 0 ?

    On other fields we have the Double field size, but then we have to enter data like 5,8 and access changes the value to 6. Is there a way to cancel the rounding of numbers in access ?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Use the Decimal Places property at the Table Layer to control floating point vs. fixed.

    If your data is being truncated and the field in the table is Double, you are most likely truncating the data before the table ever sees it. Take a look at your controls and or variable types. It seems you are using an integer type somewhere.

  3. #3
    Johanb26 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    25
    Quote Originally Posted by ItsMe View Post
    Use the Decimal Places property at the Table Layer to control floating point vs. fixed.

    If your data is being truncated and the field in the table is Double, you are most likely truncating the data before the table ever sees it. Take a look at your controls and or variable types. It seems you are using an integer type somewhere.
    When viewing the table, the data in the table is already truncated to 0 instead of showing the 0,017 value.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Johanb26 View Post
    When viewing the table, the data in the table is already truncated to 0 instead of showing the 0,017 value.
    Yes, I understand. Consider the method used to populate the field if the field is of Type Double.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Johanb26 View Post
    I am viewing the table in design view and it has the following properties:


    Data type: Number
    Field Size: Double
    Format:
    Decimal places: 4
    Input mask:
    Caption
    Default value:
    Validation rule:
    Required: No
    Indexed: NO
    Text Aling: general

    I have no idea where else to set the settings to change the data so that 0.001 etc won't be rounded to 0.

    The data is entered in a form though with a txtbox.

    On the txtbox the format is empty, and decimal places is set to 4.
    Is the user typing directly into the Textbox? Try formatting the textbox. Use the Format tab on the property sheet for the textbox control. In the Format Field, select "General Number".

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-20-2013, 12:19 PM
  2. Replies: 3
    Last Post: 05-31-2013, 04:32 PM
  3. Access Query Data Type
    By tmcrouse in forum Queries
    Replies: 1
    Last Post: 07-19-2012, 02:29 PM
  4. Access and SQL Server data type problem
    By rayc in forum Access
    Replies: 1
    Last Post: 09-10-2010, 07:27 PM
  5. Replies: 2
    Last Post: 03-18-2010, 08:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums