Page breaks conditional on can-grow text box?

S

SolomonT

I am trying to insert a conditional page break based on the height of
text box that has its "Can grow" option set to true. I made the pag
break conditional by creating a On Format event for the subreport'
Detail with this code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me![Can_grow_text_box].Height > 500 Then 'Height is in twips
567twips/cm...
Me![Conditional_page_break].Visible = True
Else
Me![Conditional_page_break].Visible = False
End If
End Sub

What I am seeing is that the condition for the page break is based o
the nominal height of the text box and not on it's height after it ha
grown.

How can I find out the height of the text box after it has possibl
grown due to the "Can grow" field being set true?


Thanks it advance
 
M

Marshall Barton

SolomonT said:
I am trying to insert a conditional page break based on the height of a
text box that has its "Can grow" option set to true. I made the page
break conditional by creating a On Format event for the subreport's
Detail with this code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me![Can_grow_text_box].Height > 500 Then 'Height is in twips.
567twips/cm...
Me![Conditional_page_break].Visible = True
Else
Me![Conditional_page_break].Visible = False
End If
End Sub

What I am seeing is that the condition for the page break is based on
the nominal height of the text box and not on it's height after it has
grown.

How can I find out the height of the text box after it has possibly
grown due to the "Can grow" field being set true?


Right! The problem is that the CanGrow Height of the text
box is not available until the Print event, but that's too
late to manipulate the page layout.

The way I find out the eventual height of a CanGrow text box
is to use the TextHeightWidth code at www.lebans.com
 
Top