Results 1 to 7 of 7
  1. #1
    CS_10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Derbyshire, UK
    Posts
    32

    Calculation not working on report

    I have a report with quite a few fields on it.



    I have a text field called Text56, and this pulls in a value from the Control Source. This works fine.

    I have another field called Text1, this does the same.

    I have added a third field and entered this in the control source: =([Text56]/[Text1])

    However, when running the report, it asks me for the value of Text56, instead of using what is pulled through in to the Text56 field!!

    I have several others like this which are working fine on my report, but this one won't work.

    Can anyone think what might be causing it?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Not sure, but if both Text56 and Text1 are fed by an underlying table or query, why not do the calculation in the query itself instead of directly on the report.
    Whenever possible, I try to do most of my calculations in the underlying query. To me, it is much easier to manage.

  3. #3
    CS_10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Derbyshire, UK
    Posts
    32
    I see what your saying Joe, but its puzzling me how exactly the same fields are working on the same report for others.

    The only difference is that I added the underlying data on to the query of the one I'm working on more recently than the others...

    What could it be?

  4. #4
    CS_10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Derbyshire, UK
    Posts
    32
    How Bizarre,

    I have since completely closed Access and reopened, and now it does it properly!!!

    Its as though it needed a refresh after adding the fields to the query.!

    However I have one other issue now.

    I have a number of Text fields that return a percentage field based on a calculation in the control source.

    I want to create a new field that displays a total of these percentages to make sure they add up to 100%.

    However I am struggling.

    In a text field, should this control source work:
    =Sum([Text7]+[Text9]+[Text69]+[Text73])

    At the minute when running the report, it is asking for the values of all 4 fields.

  5. #5
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    When referring to an object, sometimes Access uses the Control Source name and sometimes the object (text box in this case) name. Best practice is to make both of these names the same, then you will not have to worry when one should be used and when the other.

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Code:
    =Sum([Text7]+[Text9]+[Text69]+[Text73])
    BTW, using the plus sign and SUM is redundant!
    You don't need SUM if you are already adding the fields together.

  7. #7
    CS_10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Derbyshire, UK
    Posts
    32
    Cheers for the help everyone.

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

Similar Threads

  1. Replies: 3
    Last Post: 01-29-2013, 04:34 AM
  2. BMI calculation formula not working...
    By coolpal9 in forum Forms
    Replies: 2
    Last Post: 03-27-2012, 12:06 PM
  3. Total Calculation, nz function, not working
    By Jojojo in forum Programming
    Replies: 3
    Last Post: 10-10-2011, 02:33 PM
  4. Report Calculation
    By Azeez_Andaman in forum Reports
    Replies: 7
    Last Post: 10-08-2011, 11:58 PM
  5. Report Calculation
    By thestclair in forum Reports
    Replies: 2
    Last Post: 03-28-2006, 12:23 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