Conditional Page Break Challenge

G

gbruintjes

I have a complex report with numerous sub-reports and need to know how
to include a conditional page break based on the existence of a sub-
report.

Below is some code I'm trying but it gives me an error. 'Object
doesn't support this property or method'

MResults = Me![SubReport_M].HasData
Me![MpageBreak].Visible = False
If MResults = 0 Then
Me![MpageBreak].Visible = True
End If

The other block I tried is this, but same error.

Me![MpageBreak].Visible = False
If Me.[SubReport_M].[HasData] Then
Me![MpageBreak].Visible = True
End If

In the end I want the page break to only show up if the sub-report has
data and shows up in the final report.
Any help would be appreciated.

Thanks,
Gerrit
 
M

Mr. B

gbruintjes,

There are two properties in your report and your sub report that may provide
you with some help.

Try setting the "Force New Page" property of your sub report to the
appropriate setting for your situation. I think "Before Section" may be what
you are looking for.

Your report has the same option and you may find that you can use this
setting in the main report to do what you what, but I would try the sub
report first.

The other setting that might be of some help is the "New Row or Col"
property.

You can test each of these properties to see the results that you get with
your data.

HTH
Mr. B
askdoctoraccess dot com
 

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