Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Sub Report not showing up


    I know I've asked this question before, but can't find the link someone shared. I have a report with several sub reports. If a sub report is null, nothing appears in the report. I need it to appear whether or not something is in it.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Well, it won't. Has to be data. I make a label display with caption "No data".
    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
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I need to go about this a different way then. The report I'm generating needs to be in a particular format. Every section needs to be included whether or not it contains information. A label with N/A or No Data will be fine as long as the format is correct. I have a report with several sub reports. Each sub report's record source comes from a query. Each sub report needs to be included, at least the format, even if there is no information.

  4. #4
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Is there a way to make a rectangle to go around the area I need to appear and have it resize to the sub report I put inside of it?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    If there is no data then report will not show - not even labels. The label I indicated is not part of the subreport. It sits on the main report. Then code in main form Detail_Format event sets label visibility. Example: Me.lblRC.Visible = Not Me.ctrRC.Report.HasData.

    If you must display the report structure then option is a duplicate report that does not have RecordSource and no textboxes, just labels. Code sets Visible property.
    Last edited by June7; 08-27-2018 at 03:46 PM.
    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.

  6. #6
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I was thinking about building the form in the report and putting the fields in their respective spots. That way, when the sub report does not appear, the structure of the report will be there. Part of that structure is an outline of the area. That's why I was wondering if there was a way I can put in a rectangle (draw a box) that will grow or shrink with the information that is there.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Try a box control or 4 line controls. What happens?
    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.

  8. #8
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    A box control or 4 line controls? I don't understand

  9. #9
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I'm going to have to force information into the fields and then make the query show what I want. That will make the sub forms appear.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Box - correction, rectangle - and line are controls available on the design tab.
    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.

  11. #11
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I'm thinking about putting in list boxes instead of sub reports. I'm getting the data from a query. In case that query is null, is there a way to make the list box say something like "N/A" ?

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Listboxes won't shrink or grow.
    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.

  13. #13
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I forgot about that. Looks like I'm back to forcing information into the query.

  14. #14
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Can figure out how to force information into it either. How do you make those labels appear if the query is null and the sub report won't appear?

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The labels are on the main report. See post 5.

    A UNION query can 'force' data.

    SELECT ID, field2, field3 FROM table WHERE something
    UNION SELECT 0, Null, Null FROM table;
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Name Not showing in Report
    By Bentley in forum Reports
    Replies: 2
    Last Post: 01-26-2017, 03:42 PM
  2. Replies: 9
    Last Post: 08-08-2016, 02:57 PM
  3. Report value showing as ID.
    By Shilabrow in forum Reports
    Replies: 3
    Last Post: 05-20-2014, 08:36 PM
  4. Replies: 15
    Last Post: 04-16-2014, 01:15 PM
  5. Replies: 2
    Last Post: 06-15-2012, 07:32 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