Results 1 to 3 of 3
  1. #1
    michaelh93 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    8

    Referencing between Sub-reports.

    Hi,

    In my report I have been able to add the values of the main report with the equivalent values of a subreport (if present) into a combined total using



    =Sum([NAMEPLATE kW])+IIf([FEEDER subreport].Report.HasData,Nz([FEEDER subreport].Report.NPkWSUM,0),0)

    This works exactly as I want, however in the footer of my report I have another subreport that acts as a summary showing only the combined sum of the values of the components (the calculation shown above) for each STATION and not the entire component list. I had been using =Sum([NAMEPLATE kW]) in the STATION footer of the sub-report and this returns the correct sum of all the values in the list of components (from the main report), but I want it to add the relevant values from the feeder subreport aswell (If applicable).

    If I try to directly refence the Textbox contained within the main report (=Reports![Equipment Demand]![Text58]) that computes the above calculation it returns the same value for every STATION in the subreport instead of the value of Text58 for each specific STATION, which is obviously wrong. (The value that is returned is the last isntance of the calculation performed in the main report.

    I tried to reference the textbox in the other subreport using =Sum([NAMEPLATE kW])+IIf(Reports![Equipment Demand]![FEEDER subreport].Report.HasData,Nz(Reports![Equipment Demand]![FEEDER subreport].Report.NPkWSUM,0),0) but no luck. It returns the =Sum() correctly but the second term seemingly has no effect. (It turns out hasdata is returning a 0).

    Can anyone suggest how I can fix my referencing?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Do you want to provide db for analysis? Follow instructions at bottom of my post.

    BTW, I deleted thread that duplicated this topic.
    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
    michaelh93 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    8
    Quote Originally Posted by June7 View Post
    Do you want to provide db for analysis? Follow instructions at bottom of my post.

    BTW, I deleted thread that duplicated this topic.
    Hi June, thanks for the reply.

    I was going to try one last thing before i sent it off and it worked!

    The subreport I was trying to reference has to be in the detail of the report and not the footer. Not sure why but it worked.

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

Similar Threads

  1. referencing a control
    By looloo in forum Programming
    Replies: 3
    Last Post: 09-23-2011, 07:57 PM
  2. Referencing Issue
    By rosh41 in forum Forms
    Replies: 1
    Last Post: 07-15-2010, 04:09 AM
  3. Referencing a Subroutine
    By Lockrin in forum Programming
    Replies: 1
    Last Post: 02-26-2010, 10:09 AM
  4. Replies: 0
    Last Post: 01-28-2009, 03:47 AM
  5. referencing each record
    By grgerhard in forum Forms
    Replies: 1
    Last Post: 11-11-2006, 08:15 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