Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Conditional Page Break 1

Status
Not open for further replies.

RDS2

Technical User
Jun 6, 2003
44
US
I have a page break hard coded in a report (always visible.)
The break is in the detail section of the report. Is there a way to set the page break to "not visible" if only "X" lines remain on the page?
 
You can set the page break visible property to False. Can you explain a little more about the lines remaining? Do you mean if there are only X number of lines left to print?
 
Yes - if there are only say, 20 lines remaining (because some controls can grow) when the page break is encountered then I want to force the page break (i. e. the page break control remains visible.) If there are more lines remaining on the page when the page break marker is encountered I would like to set its property to invisable and let page breaking occur normally.
 
You can check the postion of the print using Report.Top

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Report.Top > 7000 Then 'Twips
    Me.PageBreakX.Visible = True
Else
    Me.PageBreakX.Visible = False
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top