Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subreport Problem (2000 SR-1)

    I

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Subreport Problem (2000 SR-1)

    I presume this is a follow on to <post#=301865>post 301865</post#> - in general we suggest you post an additional message to the same thread rather than starting a new one, but trecking on. . . .

    Are you sure you have the Child and Master fields for the subreport control set correctly - are they set at design time, or are they set dynamically in code? That is often a cause of problems with subreports. If that isn't the issue, then how many records do you have in the control source of the subreport for each record in the main report? If you have more than one you will get a subreport for each of the subreport records. It is possible that you don't really want a subreport, but some sort of grouping query that provides the basis for your report, but you will need to provide more information about your table structures and what you are trying to accomplish with your report.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subreport Problem (2000 SR-1)

    Yes, it's a followup to that post. Sorry for posting twice--I thought a reply to that earlier post might have gotten buried in the forum.

    The Child/Master fields are set at design time. The main report includes the key field CorrID, the QCorrCR field, and the CorrCR field (which comes from the subreport and is pulled from the same field in the same table as the QCorrCR field). The most important table includes the CorrID and CorrCR fields. The processing starts with the selection of a QCorrCR field, which uses the CorrID field to find other CorrCR values that share that CorrID.

    The subreport field is supposed to show these related CorrCR values in line with ScreenID and CorrDesc fields (with QCorrCR in the heading). CorrID and QCorrCR fields are the Child/Master fields. Report rows appear for each of the related CorrCR values. Applying Hide Duplicates to the ScreenID and CorrDesc fields makes them appear only once, but the subreport-based CorrCR field keeps appearing multiple times.

    Thanks,
    Bob

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subreport Problem (2000 SR-1)

    If you need HideDuplicates, apparently records of the main report are repeated. Since you stated that you set Unique Values to Yes in the query that acts as Record Source of the report, this query must contain a superfluous field or fields. I would suspect overlap between the data displayed in the subreport and the main report. See if you can remove a field from the query.

    Note: if you post a new reply to an old thread, that thread will automatically move to the top of the list, since threads are sorted (descending) by the date of the most recent post in the thread.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Subreport Problem (2000 SR-1)

    I think Hans is on the right track here - and it may well be that you have a schema inconsistency which is at the root of your problem, but without seeing the database that's pretty hard to tell. May I suggest that you create a query the includes the data source for the main report joined to the data source for the subreport and see how many records you get for each record to be printed on the report. If you get more than one, then the issue is not with the subreport. Alternatively, if you want to strip you database down to the bare essentails, one of us could take a look and see what is going on.
    Wendell

  6. #6
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subreport Problem (2000 SR-1)

    Hans' suggestion to look for superfluous fields really helped. The query under the main report was outputting a field that only needed to be outputted by the subreport query. I was able to finally produce my output. Thanks for the good advice.

    As things have turned out, I've had to add a second subreport field on the main report. Now I'm getting an "Enter Parameter Value" dialog box that asks for a value for the field I'm trying to pass from the subreport to the main report. I tried hitting OK with no value, and the main report produced what I wanted, but I'd still like to get rid of this "Enter Parameter Value" dialog box. I understand that this dialog box appears when a value is needed to continue processing, but nothing in the subreport query indicates that a parameter dialog box should be prompted.

    Thanks,
    Bob

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subreport Problem (2000 SR-1)

    How are you referring to the subreport "field" on the main report?

  8. #8
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subreport Problem (2000 SR-1)

    Do you mean the subreport Name, Source Object, Child/Master Field relationship, or something else?

    Bob

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subreport Problem (2000 SR-1)

    Bob,

    You wrote "I've had to add a second subreport field on the main report." I may have misunderstood; do you mean that you added a second subreport? If so, yes, I'd like to know the items you mention, plus the Record Source of the subreport.

  10. #10
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subreport Problem (2000 SR-1)

    Hans,

    Yes, this is a new subreport--sorry about the confusion. The subreport name (on the main report) is "Screen IDs". Its Source Object is "Report.AdHocCorrectionsNew Subreport -- Screen IDs". The Child/Master fields are both named CorrID.

    The actual subreport outputs the ScreenID field and is built by the "AdHocCorrectionsNew Subreport -- Screen IDs Query" query, which uses this SQL:

    SELECT Screens.ScreenID, Screens.CorrID
    FROM Screens;

    Thanks,
    Bob

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subreport Problem (2000 SR-1)

    Thanks. I think this is the first time I've seen a query whose name is longer than its SQL string. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    So, if I understand correctly, this subreport is linked to the main report by CorrID, and when you open the report, you get prompted for CorrID. Is that correct?
    - If so, do you have a control bound to CorrID on the main report?
    - And if not, what do you get prompted for?

  12. #12
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subreport Problem (2000 SR-1)

    It prompts for the ScreenID. CorrID is the linking field between the subreport and the report.

    Thanks,
    Bob

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subreport Problem (2000 SR-1)

    What happens if you try to open the "AdHocCorrectionsNew Subreport -- Screen IDs" report from the database window? Do you get prompted for ScreenID then?

  14. #14
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subreport Problem (2000 SR-1)

    No, it just produces a report showing all Screen IDs.

    Bob

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subreport Problem (2000 SR-1)

    Is there a chance that you can post a zipped, compacted, stripped down copy of the database? Delete everything from the copy that is not relevant to the problem, leave only a few records in the remaining tables, and scramble sensitive data. The zip file should be less than 100 KB.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •