Subreport A does not display, Subreport B repeats

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • whethergirl
    New Member
    • Jun 2010
    • 2

    Subreport A does not display, Subreport B repeats

    I have a Main report in my database with two Subreports ("Level" and "Quality"). Each (sub)report is based on a different query, but all queries include the same field ("Location") from the same table and it appears on each (sub)report for debugging purposes. This field is the Master/Child link.

    I have run each subreport independently (both have controls only in their Details section), and they function well (the report repeats for each Location).

    The "Location" field is displayed in a bound text box the Detail section of Main (which is grouped by a different field from the Main query). Both subreports also appear in the Detail section.

    I would like my report to show:
    ~~~
    "Location"
    Level Subreport for that Location
    Quality Subreport for that Location
    ~~~
    for each Location (the ~s are meant to separate the report appearance from my question). What currently appears is:
    ~~~
    "Location"

    Quality Subreport for that Location
    Quality Subreport for the next Location, etc.
    ~~~
    where etc means that Quality Subreports for all locations are shown for each location in the Main report. The blank line between "Location" and the first "Quality Subreport" represents that the Level Subreport does not appear (nothing of its skeleton and nothing of its controls).

    Additionally (I mention this only in the hopes that it helps the trouble shooting), I have a rectangle around the Detail section of Main. The extra Quality Subreports appear below the rectangle, something like (except that the vertical edges actually line up, this does not happen when this message posts, sorry):
    ~~~
    _______________ _______________ _______________ _____
    | "Location" |
    | |
    |___Quality Subreport for that Location __|
    Quality Subreport for the next Location, etc.

    ~~~
    The Format and Data for the subreports are identical apart from the Record Source.

    I've been working on this issue for a couple of days. I'm presenting the database tomorrow and I'd like to have this report working by then.

    This is my very first forum post and I am new to Access so I apologize for the funny notation. I don't speak much VBA or SQL, so I hope that solutions aren't too complicated.

    Many thanks for all help.
  • whethergirl
    New Member
    • Jun 2010
    • 2

    #2
    Problem Solved!!!!

    The missing subreport: I'd been filtering the entries to the Main report (perhaps I should have mentioned that) while I worked out the bugs. I used a criteria for the location in the query that the Main report references. There were no data entries for the Level subreport for those Locations. I stuck some in and now the Level subreport appears. The Level subreport appears only once per Location (as it should).

    The repeating subreport: it's query wasn't saving properly before, so (in the query) I had referenced the Location field (from the central table) by giving it a different name/label (I don't know what that's called, but it's when you build the field with "Label: TableName![FieldName]" for example). I closed and reopened the database and the query started saving properly. So I reference the Location field directly and now my subreport doesn't repeat.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32661

      #3
      Sometimes, just laying the problem out clearly (as you've done quite well here - though it's still complicated to understand - it's not a simple problem after all), as is so necessary for sharing on a forum, is enough to trigger your own understanding to find the solution. It's very gratifying when that happens so I'm pleased for you :)

      By the way, thanks for posting back with the solution. Threads with solutions are always so much better than those without of course.

      Welcome to Bytes!

      Comment

      Working...