Results 1 to 9 of 9
  1. #1
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    Feeling really stupid

    Done it a thousand times, and cannot get it now. I simply need the total from my subreport (Mileage) to show up on my main report (bidreport). I have the following field in the BidReport report footer:
    Code:
    =[Mileage].[Report]![MileageGrandTotal]
    and it will only give me the last group total from the subreport! I've tried all sorts of variations. does it matter that I have the Mileage subreport in the BidDate footer of the BidsReport? I am trying to show mileage for each day - and then a grand total at the end.

    TIA. Happy Memorial Weekend all!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    ALWAYS use the builder button. This will allow you to pick the item from a list and spell it correctly.
    you would have chosen , REPORTS, OPENREPORTS, rMyreport, childRpt, [milageTotal

    So whatever the text box name is....NOT the name of the field, but sometimes they ARE the same.
    but you must reference the SUB RPT name. usu CHILD1,2
    [child1].[Report]![MileageGrandTotal]

  3. #3
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    I did! The name of the subreport is "Mileage". And the name of the field is MileageGrandTotal.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    I always give container controls a name different from the object they hold, like: ctrMileage.

    Then reference field:

    =[ctrMileage]![MileageGrandTotal]

    reference a control:

    =[ctrMileage].[Report].[tbxMileageTotal]
    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
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    Quote Originally Posted by June7 View Post
    I always give container controls a name different from the object they hold, like: ctrMileage.

    Then reference field:

    =[ctrMileage]![MileageGrandTotal]

    reference a control:

    =[ctrMileage].[Report].[tbxMileageTotal]
    Thank you June, I had in fact tried changing the name after I posted my question to no avail. This really makes no sense what-so-ever. I've tried recreating the reports in case something was wonky - and nothing.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    newdbzip.zip
    Ok here it is. thank you so much for taking the time.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Doesn't seem to be pulling the last group total from the subreport, it is pulling 98 which is the second although it is the last record in the unindexed Mileage table. Interesting, would not have expected that.

    As structured, each contact can have only one bid date. Which is fine if repeat customers is not common in your business operation. The Mileage table has only bid date as identifier. Yet there are multiple contacts for a date. Shouldn't the Mileage table have contact ID as foreign key? Are all miles for a date lumped together? If so, there is no way to break out miles to each contact. If that doesn't matter then I suppose the date as key field is fine.

    Seeing the report and then re-reading your post does help. Changing location of subreport does not help. Removing the Master/Child links does allow the expression to pull a grand total but then the subreport displays all mileage dates under each bid record. Cannot get the grand total you want by referencing that subreport. This will require another subreport in the report footer or a DSum() expression or a nested subquery in the main report RecordSource.
    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.

  9. #9
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    Quote Originally Posted by June7 View Post
    Doesn't seem to be pulling the last group total from the subreport, it is pulling 98 which is the second although it is the last record in the unindexed Mileage table. Interesting, would not have expected that.

    As structured, each contact can have only one bid date. Which is fine if repeat customers is not common in your business operation. The Mileage table has only bid date as identifier. Yet there are multiple contacts for a date. Shouldn't the Mileage table have contact ID as foreign key? Are all miles for a date lumped together? If so, there is no way to break out miles to each contact. If that doesn't matter then I suppose the date as key field is fine.

    Seeing the report and then re-reading your post does help. Changing location of subreport does not help. Removing the Master/Child links does allow the expression to pull a grand total but then the subreport displays all mileage dates under each bid record. Cannot get the grand total you want by referencing that subreport. This will require another subreport in the report footer or a DSum() expression or a nested subquery in the main report RecordSource.
    This little db is something I had to slap together for myself in the couple of minutes I had to get a report out. Thus the need for the Grand total of mileage, which I only need by date, not by bid.

    Thank you for taking a look at it June, at least I know the issue isn't my imagination.

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

Similar Threads

  1. Being Stupid - #div/0
    By Epona in forum Queries
    Replies: 1
    Last Post: 06-09-2012, 09:15 AM
  2. That giddy feeling
    By TheShabz in forum General Chat
    Replies: 11
    Last Post: 01-03-2012, 02:49 PM
  3. Stupid Question ?
    By nood in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:54 AM
  4. I can't be this stupid
    By corquando in forum Import/Export Data
    Replies: 2
    Last Post: 03-01-2010, 04:12 PM
  5. Why is Access so stupid?
    By dvongrad in forum Queries
    Replies: 1
    Last Post: 11-14-2009, 10:14 AM

Tags for this Thread

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