page break

D

deb

I have a report called rProjMonthly with 2 subreports (Sched and Finance)
Sched is under GroupHeader0 and Finance is under GroupHeader1
Each has the ForceNew Page on Before Selection

A blank page prints when there is no data in one of the subreports.
I put this in the On Format event ... but I don't know how to find the name
of MyPageBreakControl.
Where can I find this?

If Me.Sched.Report.HasData = 0 Then
Me.MyPageBreakControl.Visible = false
Else
Me.MyPageBreakControl.Visible = True
End If
 
S

S.Clark

Use the intellisense to help locate the name. Type "me.", and it should
expand, or press Alt+Space to force it. Select from the list.

FWIW, you can write your code like this:
Me.MyPageBreakControl.Visible = Me.Sched.Report.HasData
 
A

Arvin Meyer [MVP]

Select the Page Break control and open the Property sheet, then look for the
Name property on the Other tab.
 
D

deb

In the groupHeader, I have Force New Page on Before Selection. How do I
find the page break control to select it?
 
J

John Spencer

"In the groupHeader, I have Force New Page on Before Selection."

There is no page break control in that case. The new page is handled by the
property of the header.

Perhaps what you want to do is hide the sub report control by setting its
visible property to false or true.

OR you could set the can shrink property of the section and the subform
CONTROL (not the subform) to Yes.,

Or perhaps if the sub report is in its own section you can cancel the section.

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Not(Me.Sched.Report.HasData)
End Sub


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

deb

Thank you John.

I tried... cancel the section. It worked great for one section(which is a
sub report) but the other is a form that I have in the GroupFooter0 and it
did not work. see below for errors.

I tried
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Not(Me.Sched.Report.HasData)
End Sub
I get RunTime error 2467 The expression you entered refers to an object that
is closed or desn't exist
and
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
Cancel = Not(Me.Sched.Form.HasData)
End Sub
I get RunTime error 2465 Application-defined or object-defined error
 

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