Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

Do Not Print Blank Subreport

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
Chi Is Current
Asked:
Chi Is Current
1 Solution
 
peter57rCommented:
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
 
Chi Is CurrentAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now