Solved

Do Not Print Blank Subreport

Posted on 2013-06-10
2
551 Views
Last Modified: 2013-06-10
Attempting to suppress a blank subreport, contained in  group footer:

When group footer contains no records, linked subreport still prints!  #?@$?%!*&

Have tried:
-------------
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
       If rptHrsCat0_SR.Report.HasData = 0 Then
       rptHrsCat0_SR.Visible = False
       End If
End Sub
-------------

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
With Me!rptHrsCat0_SR.Report
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With
End Sub

-------------
In the Subreport On No Data property:
-------------
Private Sub Report_NoData(Cancel As Integer)
Cancel = True

End Sub
-------------

When the subreport is opened alone, only records containing data print.

Have made certain the Group Footer property: Can Shrink = Yes
Have made certain ALL subreport properties: Can Shrink = Yes

Must be missing something here; would appreciate illumination.

Thank You, Jacob
0
Comment
Question by:Chi Is Current
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 39236869
Try this.  Use the subreport NoData event procedure...


Private Sub Report_NoData(Cancel As Integer)
     Cancel = True
End Sub

 Then...

 With the main report in design view,  set the Can Shrink property of the subreport container control to Yes, as well as the Can Shrink property of the group footer section.
0
 
LVL 2

Author Comment

by:Chi Is Current
ID: 39236881
Thank you for your reply, peter57r!!

Client is using the same field for different kinds of information!  #?@$?%!*&

In the interim decided to change strategies and write ODBC function to straighten out the data for the report.

Best Regards, Jacob
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question