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


.



Relevant Pages

  • Re: Report Page footer wont print
    ... the way you'd like subreports to work is not the way they ... Both main report& sub report are bound to basically the same query,with ... sheet of A4 paper. ...
    (comp.databases.ms-access)
  • Re: Report Page footer wont print
    ... the way you'd like subreports to work is not the way they actually ... The subreport's page footer doesn't print. ... Both main report& sub report are bound to basically the same query,with ...
    (comp.databases.ms-access)
  • Re: Send an "In (Criteria)" parameter to a query
    ... I got it to work, just had to produce the query in SQL, not the design grid ... As for the report part of your post, it wasn't something I was considering ... limit output, but since the sub report is the limiting factor, I couldn't do ... <no sub report data> ...
    (microsoft.public.access.queries)
  • Re: Send an "In (Criteria)" parameter to a query
    ... The query won't find a record w/ a column value of "'SMP','MFC'". ... I'm not sure you can cancel a report if a sub report doesn't have any ... There is a property of a sub report called HasData. ... <no sub report data> ...
    (microsoft.public.access.queries)
  • Re: Open Report using current record
    ... in the recordsource of your sub report for the other two the dates). ... Holiday End Date are actually located on the subreport, ... Record Autonumber and the control source is also Record is this right or does ...
    (microsoft.public.access.forms)