Results 1 to 5 of 5
  1. #1
    Jessica240 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    95

    Calculating a value on a text box from a sub-total

    Hello everyone! This should be a pretty easy question:



    Okay, so I have a report that groups information from a query, and subtotals a payable amount. It looks something like this:

    Group A..... Item#... PAYABLE

    1...........$50.00
    2...........$23.00

    subtotal: $73.00



    Group B.........Item #.....PAYABLE
    3..........$16.00
    4..........$200.00

    subtotal: $216.00




    What I'm trying to then do is have a section on the bottom of the report that takes each subtotal amount (the $73.00 and the $216.00) and multiplies it by 95%. I want it to look like this:

    Group A: $69.35
    Group B: $205.2


    I need it to be in the report footer. So I put in some text boxes, go to their properties, and under the "data" tab where I enter in the control source, I try to type in an expression but none of them work.

    I can't get Access to isolate each of the subtotal amounts:


    Control Source = [AccessTotalsPAYABLE]*.95

    But doing this results in Access taking the grand total from my PAYABLE field instead of each subtotal.... How can I write my expression so that Access will let me use the value from each subtotal?


    Thank you in advance for your help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Something like:

    =Sum(IIf(Group = "A", Payable, 0)) * .95
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    There is only one textbox for the Subtotal.

    If you also want the subtotals to show in the report footer, then need a textbox and an expression for each group:

    =Sum(IIf([Group]="A", [AccessTotalsPAYABLE], 0))
    =Sum(IIf([Group]="B", [AccessTotalsPAYABLE], 0))

    How many groups are there?

    Or build a subreport in the report footer.
    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.

  4. #4
    Jessica240 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    95
    Well the thing is, the groups will change periodically..... The grouping is by department and our company has about 50 different departments. Each report is for one employee who might work in several different departments....

    So for example, I have employee Bob who might work in sales one week, customer service and kitchen the next week, then lawn care the third week.

    My query calculates the payable amount from each department which I need isolated so I can do my accounting duties with each subtotal from each department.

    So it would look like this:

    Report header: Employee: Bob Smith

    Sales Department


    ..............Item #....Payable

    ................5............$300.00
    ................14...........$415.00

    subtotal:..................$715.00

    Customer Service Department

    ..............Item #.......Payable

    ..................6............. $250.00
    ..................8..............$350.00

    subtotal:.....................$600.00




    So I can't use an IIF statement because we have 100+ employees with 50 departments. I would have to create 50 different text boxes for each report so that each text box could have its own iif formula...

    That's why I was hoping Access had a way that it could isolate each subtotal into a textbox that could be used for calculating formulas in other text boxes....

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would create a totals query against the record source of the report and base a subreport on it.
    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. Calculating the total number
    By billylids5 in forum Forms
    Replies: 1
    Last Post: 04-27-2014, 04:06 AM
  2. Calculating Total on the report
    By Natella in forum Reports
    Replies: 5
    Last Post: 11-12-2013, 11:08 AM
  3. Replies: 4
    Last Post: 08-14-2012, 10:33 AM
  4. Calculating the Total of Average Fields
    By DDEB in forum Queries
    Replies: 1
    Last Post: 05-09-2012, 06:26 PM
  5. Need help with calculating Time total
    By Monoceros in forum Reports
    Replies: 1
    Last Post: 04-20-2009, 12:44 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