Results 1 to 4 of 4
  1. #1
    lborn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    7

    Check multiple subreports for data, if no data hide group header and detail.

    I have a main report that is bound by a query that lists room numbers in a department (the department is selected from a form, and then the report is run from a command button that filters the report on open).

    The report has 2 group headers: one that acts as the first page of the report, and one that shows details about each room (number, name, and the headers for the columns from the subreports because they are the same regardless of type of item). The report forces a page break after a room's information, a room could have one or more pages depending on how many items are in that room.

    In the report's detail there are three subreports that show different items that are in that room (art, furniture, equipment). The subreports are are linked by DeptID and RoomID.


    A room may have each subreport showing data, or a combination of, or no data at all.


    If the subreports have no data, I don't want to show the group header or detail for that room.


    I have tried a few different ways of accomplishing this, but I seem only to be able to hide all of the room related group headers, or all of the detail, not on a case-by-case basis. Is this done through VBA in the OnFormat or OnPrint events, or is it something I could change in the query for the main report?


    Thank you for any help you might be able to give on this!


  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Fix the query, that is the best way. You can left join the three queries for the subreports and make sure that at least one of them has data.

  3. #3
    lborn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    7

    Thank you!

    Quote Originally Posted by aytee111 View Post
    Fix the query, that is the best way. You can left join the three queries for the subreports and make sure that at least one of them has data.
    This did the trick.

    Thank you very much, I appreciate your answer! Sorry it took me so long to say thank you!

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Glad it worked!

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

Similar Threads

  1. Replies: 6
    Last Post: 12-14-2015, 03:25 PM
  2. Replies: 6
    Last Post: 10-30-2014, 12:59 PM
  3. Replies: 9
    Last Post: 04-21-2013, 05:37 PM
  4. Replies: 0
    Last Post: 02-25-2013, 04:43 PM
  5. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 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