Re: Question about reports, subreports, and page breaks

Thanks! This solved my problem to a T! :)

SA wrote:

Place a page break control just before each sub report, keeping the subs in
the detail section.

In the detail section's on format property add code like this:

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

End if

That should do it.

ACG Soft

"David" <consulttech2004@xxxxxxxxxxx> wrote in message

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.