How to avoid blank pages in a report, when there are no data

R

rmcruz

Hello There,

I have a report with a page break, and under it a subreport. So I want to
print data from the subform on a new page. However there are cases that I
have no data to print, and access creates a blank page on the report.
Is there a way to tell access to avoid creating this blank page, everytime
that there are no data to display?

Regards and thanks in advance.

Ricardo
 
D

Duane Hookom

You can set the visible property of the page break control based on the
HasData property of your subreport.
Me.PageBreakName.Visible = Me.srptName.Report.HasData
 
J

John Spencer

Yes, use the HasData property of the subreport to control the visible property
of a page break control.

If you are controlling the printing of the subreport by some other method,
tell us how you are forcing the page break to occur.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
R

rmcruz

Hello Duane,

thank you for your answear.

However I am getting an error.
Where can I set this propertie? Is it on the report open event? It seems
that the control pagebreak has no propertie for visibility.

Thanks again.
 
D

Duane Hookom

Sorry, I should have specified the code would be in the On Format event of
the report section containing the page break control and subreport.

The Visible property is there but not exposed in the Property Dialog or
intellisense.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top