Solved

Do Not Print Blank Subreport

Posted on 2013-06-10
2
539 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS Access Bound Objects. 6 28
Access MDB/PDF 21 32
Best Approach MS Access 2013 3 20
Help with SQl and UNION 3 19
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now