Question about reports, subreports, and page breaks

D

David

Folks,

I have four subreports in a report in the detail section. I suppose I
could move them to the footer of the report. Anyway, if any of them
have data, I want the main report to force a page break. I am trying
to use the "hasdata" property for the subreports, but I am getting the
generic error indicating property not available for object.

How does one tell the main report (using VBA) not to throw in a page
break unless the subreport has data? There has to be an easy set of
code for this. Thanks.

David
 
D

David

I did just that! Someone sent me this code here:

If FormatCount = 1 Then
If Me!YourSubRptName.Report.HasData = True then
Me!NameOfFirstPageBreakControl.Visible = True
Else
Me!NameOfFirstPageBreakControl.Visible = False
End if
'........Repeat for each sub report.


End if

....and it worked just fine (with a little jiggling!)

Thanks,

David
 
Top