Results 1 to 4 of 4
  1. #1
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376

    Same forms act differently in different databases

    Hello all,



    I have run into an interesting issue this evening. I have a form that I copied from 1 database to another. 1 field in a subform works great in the first database, the same field in another acts differently. The field contains a currency value and when entered it can contain a value like 0.578125.

    In the first database it works perfectly, it shows 0.58 but the 0.578125 is actually held as the value and that value is later used in a calculation.

    In the second database it works differently, it shows 0.58 but the 0.5781 is actually held as the value, and this doesn't calculate correctly, it needs all of the decimal places, ie. it can't be rounded off.

    Can someone shed some light on why this is happening please?

    Thanks

    Dave

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Have you checked the datatypes in the underlying tables in both dbs?

    Cheers,
    Vlad

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    The data in each field is stored in the table NOT the form
    So the table design must be different in the table in each database

    As an example, the 3 number fields in this table are all DOUBLE datatype and have decimal places set as 4,6,2 respectively

    Click image for larger version. 

Name:	Capture1.PNG 
Views:	10 
Size:	6.2 KB 
ID:	33022

    Notice that the tables are actually storing numbers with more than the specified number of decimal places

    Next I'll change the Format for all 3 fields to Fixed in the table design
    Now the fields show the number of decimal places specified in the design

    Click image for larger version. 

Name:	Capture2.PNG 
Views:	10 
Size:	5.6 KB 
ID:	33023

    However the data stored hasn't changed - if I remove the Fixed format, the original data is seen again

    Also if I use the data in a calculation, it uses all the decimal places whether or not they are visible
    ... UNLESS I specifically prevent that happening by using a function like ROUND or INT or FIX

    You need to look at the actual data stored in your table

    Hope that helps
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    Thank you so much, that was it, for some reason then tables were formatted differently and I never noticed it. I had checked that the forms were both formatted the same but didn't check the tables because I thought they would have been the same.

    Thank You Gicu and Colin

    Dave

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

Similar Threads

  1. Frontend Backend Databases Forms to Tables
    By raychow22 in forum Access
    Replies: 2
    Last Post: 07-08-2017, 03:49 AM
  2. Replies: 10
    Last Post: 08-12-2015, 10:21 AM
  3. Replies: 8
    Last Post: 04-18-2014, 02:24 PM
  4. Sub Forms work Differently?
    By djclntn in forum Forms
    Replies: 1
    Last Post: 12-06-2012, 12:51 PM
  5. Two people see same file differently
    By jeffreydennis in forum Access
    Replies: 12
    Last Post: 06-11-2012, 09:50 AM

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