Re: Question about reports, subreports, and page breaks



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

SA wrote:
David:

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
Else
Me!NameOfFirstPageBreakControl.Visible = False
End if
'........Repeat for each sub report.

End if

That should do it.


--
SA
ACG Soft
http://www.groupacg.com

"David" <consulttech2004@xxxxxxxxxxx> wrote in message
news:1157953094.596748.236410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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


.