Results 1 to 11 of 11
  1. #1
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155

    Regarding Reports

    I have a Report that contains several sub-reports. If a sub-report does not contain data then it should not be printed and the sub-report following it should cover up the space(i.e. there should not be any blank spaces in the printed Report). How can this be achieved?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Not sure this will work but perhaps set the sub reports Can Shrink and Can Grow properties to Yes and make the height of the sub report control very small on the main report.
    Last edited by Bob Fitz; 07-17-2018 at 02:16 AM. Reason: Clarity
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155

    Regarding Reports

    Quote Originally Posted by Bob Fitz View Post
    Not sure this will work but perhaps set the sub reports Can Shrink and Can Grow properties to Yes and make the height of the sub report control very small on the main report.
    What is the significance of Event "On no Data". Can we use it to make the sub-report invisible if there is no data?

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by Kundan View Post
    What is the significance of Event "On no Data". Can we use it to make the sub-report invisible if there is no data?
    As its name suggests its an event that fires when there is no data. I don't know of a way to use it to fulfil your requirements.
    What difference did my suggestion in post #2 make
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155
    Quote Originally Posted by Bob Fitz View Post
    As its name suggests its an event that fires when there is no data. I don't know of a way to use it to fulfil your requirements.
    What difference did my suggestion in post #2 make
    Yes I tried the Can Shrink prop. The sub-report shrinks but Labels etc.are still visible.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by Kundan View Post
    Yes I tried the Can Shrink prop. The sub-report shrinks but Labels etc.are still visible.
    Perhaps you could delete the sub report labels and and replace them with a label held within the sub report.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155
    Quote Originally Posted by Bob Fitz View Post
    Perhaps you could delete the sub report labels and and replace them with a label held within the sub report.

    The Labels etc. within the sub-report itself remain visible.
    Some way should be found to make the sub-report invisible when there is no data.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I know this has been asked many times.

    I faced same issue. Subreport is blank when no data - not even labels, just lots of white space. I have code in main form Format event that displays label stating "no data for this section". Example:

    Me.labelName.Visible = Not Me.subreportContainerName.Report.HasData
    Last edited by June7; 07-20-2018 at 10:02 AM.
    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.

  9. #9
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155
    Quote Originally Posted by June7 View Post
    I know this has been asked many times.

    I faced same issue. Subreport is blank when no data - not even labels, just lots of white space. I have code in main form Format event that displays label stating "no data for this section". Example:

    Me.labelName.Visible = Not Me.subreportContainerName.Report.HasData
    Your solution appears to be attractive. Kindly explain with detail example.

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    What do you not understand about instructions already given? Do you know how to write VBA code?
    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
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155

    Regarding Reports

    Quote Originally Posted by June7 View Post
    What do you not understand about instructions already given? Do you know how to write VBA code?

    I tried using a Label indicating "NIL". It worked. THANKS! GOD BLESS YOU!!!

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

Similar Threads

  1. Replies: 3
    Last Post: 07-13-2018, 12:14 PM
  2. Replies: 13
    Last Post: 02-08-2017, 04:11 PM
  3. Convert Client Reports to Web Reports
    By need_help12 in forum Reports
    Replies: 0
    Last Post: 05-08-2012, 08:22 AM
  4. Reports w/ sub-reports very slow to open
    By vaikz in forum Reports
    Replies: 2
    Last Post: 02-27-2011, 08:41 AM
  5. Access Reports drop sub-reports
    By Kevin Ellis in forum Reports
    Replies: 0
    Last Post: 11-19-2010, 03:28 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