Results 1 to 3 of 3
  1. #1
    Forums10 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    3

    Sum total on our report is not working


    The code that we have tried to total the column Profit or Loss $ without success
    ===
    sum([ProfitLoss])
    =(Sum([ProfitLoss]))
    sum=([ProfitLoss])
    sum(=Nz([BookValue_Market])-Nz([BookValue_Cost]))
    sum(Nz([BookValue_Market])-Nz([BookValue_Cost]))
    =sum(Nz([BookValue_Market])-Nz([BookValue_Cost]))
    =Sum(([BookValue_Market])-([BookValue_Cost]))
    Sum(([BookValue_Market])-([BookValue_Cost]))
    Sum([BookValue_Market])-([BookValue_Cost])
    ===
    Can I please have a suggestion on how to have a total for our reports?
    .
    Thank you
    Barbara
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Aggregate functions cannot reference controls, only fields in the report RecordSource. Do the calcs for [BookValue_Market] and [BookValue_Cost] in a query that is the RecordSource. Bind controls to those constructed fields and reference those fields in the aggregate calc.

    BTW, advise not to use spaces and special characters/punctuation (underscore is exception) in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You can't sum a calculated control, only fields. You can recreate the calculations in the sum, or copy the ProfitLoss textbox, set the running sum property of the copy to Over All, hide it, and refer to it in the report footer.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 01-18-2015, 06:05 PM
  2. Replies: 6
    Last Post: 03-29-2014, 08:47 PM
  3. Replies: 3
    Last Post: 01-29-2013, 04:34 AM
  4. Total Calculation, nz function, not working
    By Jojojo in forum Programming
    Replies: 3
    Last Post: 10-10-2011, 02:33 PM
  5. Replies: 1
    Last Post: 06-29-2010, 03:40 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