Results 1 to 6 of 6
  1. #1
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107

    Report Total from a query

    I have searched online and haven't been able to find a solution for this problem. I have a report that groups on Resource. Each resource is displayed as a single line on the report, and contains fields that apply to the resource, such as budgeted hours, actual hours, and total wages. I am trying to display a running total in the report footer for the budgeted hours, actual hours, and total wages fields. The main report (grouped by resource) will only show resources that have actual hours recorded. Currently, my report footer totals are displaying the budgeted hours for EVERY resource, and for every month, not the resources (and filtered month) displayed by my report query. For the month of April, my budgeted total should be 2,000, not 55,000 hours.

    Is there a way to have the running total within my report footer equal only resources that are filtered within my report?

    Thank you 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,530
    You haven't shown how you get the totals, but it would seem like you could base them on the query instead of the table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    Thank you for your response PBaldy, I apologize for not being more clear. I have tried basing the totals on table and on the query, and receive the same results. Please see below for a sample of the database design:

    Budget
    Resource
    Yr
    MoNum (as number, such as January = 1)
    MonthHrs

    My query (titled budgetmonthcalc) to get the budget from the user entered period is as follows:

    Code:
    SELECT Budget.Resource, Budget.MonthHrs AS BudgetMonthHrs
    FROM Budget
    WHERE (((Budget.MoNum)=Month(CVDate((Forms!Form1!PeriodTextBox.Value)))) And ((Budget.Yr)=Year(CVDate((Forms!Form1!PeriodTextBox.Value)))));
    Where the parameters are pulling the date based upon a user entered period on form1.

    When setting the textbox in the report footer section to =Sum([budgetmonthcalc].[BudgetMonthHrs])

    I still get the 55,000 budgeted hours for all resources/months, despite my query displaying the correct resources and month budget hours.

    Does this explain in more detail my situation? Is there something that I could change to fix this?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    You said the main report only shows filtered records. How is it filtered?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Try removing the Sum().
    Create a hidden text box in the section where your budgetMonthHrs is, type = BudgetMonthHrs, and setting the running sum to Over group.
    In the footer text box type =ThetextBoxYouMade. Leave the Running Sum at no.

    Dale

  6. #6
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107
    Thank you Dale, this worked perfectly!! You have saved me many hours of beating my head against the wall

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

Similar Threads

  1. Replies: 4
    Last Post: 10-12-2012, 03:42 PM
  2. Total in a report
    By jenncivello in forum Reports
    Replies: 2
    Last Post: 07-19-2012, 12:49 PM
  3. Sub Total and Overall Totals in a Report
    By StevenCV in forum Reports
    Replies: 3
    Last Post: 02-27-2012, 08:09 AM
  4. Replies: 1
    Last Post: 06-29-2010, 03:40 AM
  5. Total all months in query or report
    By Brian62 in forum Queries
    Replies: 2
    Last Post: 10-23-2009, 08:41 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