Results 1 to 7 of 7
  1. #1
    ProjectHelp is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    6

    Subtracting aggregate fields in a report

    Hi all,



    I'm trying to create an expense report based off two tables. I have a table for Bouts, and a table for Bout transactions. In the Bout transaction table there is a field that specifies whether the transaction is an expense or a revenue.

    I'm trying to create a report that will split the transactions out by expenses and revenues, then in the summary show the total income, (income - expenses.) I have the report formatted, but I'm not sure how to get the grand total, any help is appreciated.

    I currently have the report laid out as such:


    Bout Name

    Revenue

    Sample Revenue 1 $100
    Sample Revenue 2 $50

    Revenue Total: $150

    Expenses

    Sample Expense 1 $100

    Expense Total: $100

    Net Total: (I would like to subtract the 150 from 100 here)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    How have you 'split' the Revenue and Expenses records - by creating two group sections in report? There is a textbox in each section to sum each group? Then in the report footer have a textbox with expression that calculates difference of those two textboxes.
    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
    ProjectHelp is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    6
    I have the report organized by transaction type, then the text box in the transaction type footer sums the transaction totals to give the Revenue or Expense totals.

    Forgive my ignorance, I'm new in regards to creating Access reports, but how would I create an expression that references the two totals in the transaction type footer? Since they share the same name I don't know how I can reference each one individually.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    So Expenses and Revenues are not in separate group sections?

    Would you like to provide project for analysis?
    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.

  5. #5
    ProjectHelp is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    6
    Sure, I've attached a zip file containing the two tables and the report. When you open the report a form will open and you'll select which bout you want to see a report of, then the report should pop up. Let me know what you think, and I really appreciate the help.

    Project Sample.zip

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    This expression in the boutname footer textbox seems to work:
    =Sum(IIf([transactiontype]="Revenue",[TransactionAmount],0)-IIf([transactiontype]="Expense",[TransactionAmount],0))
    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.

  7. #7
    ProjectHelp is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    6
    That's exactly what I needed, thank you so much for helping me out June7!

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

Similar Threads

  1. vba > subtracting time
    By metokushika in forum Access
    Replies: 2
    Last Post: 12-09-2014, 09:17 PM
  2. Adding/Subtracting
    By JayX in forum Access
    Replies: 1
    Last Post: 12-15-2011, 01:47 PM
  3. subtracting the value of fields in a form
    By petterros in forum Forms
    Replies: 0
    Last Post: 01-14-2011, 11:46 AM
  4. Replies: 2
    Last Post: 08-05-2010, 08:16 AM
  5. Subtracting Fields
    By zakslaher in forum Access
    Replies: 15
    Last Post: 03-30-2010, 09:36 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