Change continued page top margin

H

h2fcell

Hello,
I have a multi record report that uses only the Detail section. At the top
of the detail section I have a Logo, Title Number, Meeting Date, and a 1 inch
in height Summary Text Box. Below the Summary Text Box, I have a Detail Text
Box that “Can Grow†= Yes. When the data in the Detail Text box is large
enough to require a second page, the second page does not show the Logo,
Title Number, Meeting Date or Summary Text which is fine, but the continued
Detail Text box move up 1 inch to take the place of the Logo, Title Number,
Meeting Date and 1 inch Summary Text box. Is there a way to add 1 inch to
the top margin of the continued Detail Text box?
 
M

Marshall Barton

h2fcell said:
I have a multi record report that uses only the Detail section. At the top
of the detail section I have a Logo, Title Number, Meeting Date, and a 1 inch
in height Summary Text Box. Below the Summary Text Box, I have a Detail Text
Box that “Can Grow” = Yes. When the data in the Detail Text box is large
enough to require a second page, the second page does not show the Logo,
Title Number, Meeting Date or Summary Text which is fine, but the continued
Detail Text box move up 1 inch to take the place of the Logo, Title Number,
Meeting Date and 1 inch Summary Text box. Is there a way to add 1 inch to
the top margin of the continued Detail Text box?


Set the Page Header section's Height to one inch. Then add
some code to the detail section's Print event:

Dim lngBottom As Long
lngBottom = Me.Top + Me.DetailText.Top) _
+ fTextHeight(Me.DetailText)
Me.Section(3).Visible = (lngBottom > 10 * 1440)

where DetailText is the name of your growing text box and
the 10 is your paper height less the bottom margin in
inches.

The fTextHeight function is available as part of the
TextHeightWidth download at www.lebans.com
 
H

h2fcell

Marsh first I’d like to thank you for your help.
I like the idea of using Me.Section(3).Visible True or False
Some details:
My report prints on 8.5 x 14 legal paper.
My Detail Section Height = 12.5â€
My Page Footer Height = .5â€
My print margins are Top = .3†and Bottom = .51â€
My “Description†Text box is 8.5â€

I tried to use the below code but instead of making the Page Header visible
on the page the condition was met it made it visible on the following page.
I’d like to stick with an IF Statement if possible.

Dim lngBottom As Long
lngBottom = (Me.Description.Height)
If lngBottom > (13 * 1440) Then
Me.Section(3).Visible = True
Else
Me.Section(3).Visible = False
End If

Any suggestions?
 
M

Marshall Barton

h2fcell said:
Marsh first I’d like to thank you for your help.
I like the idea of using Me.Section(3).Visible True or False
Some details:
My report prints on 8.5 x 14 legal paper.
My Detail Section Height = 12.5”
My Page Footer Height = .5”
My print margins are Top = .3” and Bottom = .51”
My “Description” Text box is 8.5”

I tried to use the below code but instead of making the Page Header visible
on the page the condition was met it made it visible on the following page.
I’d like to stick with an IF Statement if possible.

Dim lngBottom As Long
lngBottom = (Me.Description.Height)
If lngBottom > (13 * 1440) Then
Me.Section(3).Visible = True
Else
Me.Section(3).Visible = False
End If


Your code ignores all the important points in the code I
posted. First, you must be able to determine if the text
box will spill over to the next page and the only way I know
of that can tell you that is the fTextHeight function along
with the top of the section (Me.Top) and the top of the text
box within the section (Me.Description.Top).

After you determine that it will or will not spill over,
then you have enough information to make the page header on
the NEXT page visible or invisible. If the page header is
visible, it pushes the continued detail section down the
page by the desired amount. When the bottom of the text box
will be on the current page, the page header for the next
page is made invisible so the next detail starts at the top
of the page.
 
H

h2fcell

Marsh,
You've been great at pointing out helpful tools to get what I needed done
accomplished. Below you said:
"to determine if the text box will spill over to the next page and the only
way I know
of that can tell you that is the fTextHeight function "

Shouldn't I be able to use the page number of the footer to make that
determination?
I’ve been testing different methods to make a label visible or not from a
“Page Header†section of a report. No Group Sections in this report.
Below is some code I’ve been trying, but I don’t get expected results.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

If [Page] = 1 Then
Me.Label19.Visible = True
Else
Me.Label19.Visible = False
End If

End Sub

Result example:
If a 2 page Report is produced, due to spill over of a memo bound text box
in the detail section.
Page 1 of 2 has the label not visible
Page 2 of 2 has the label visible

If a 4 page Report is produced, due to spill over of a memo bound text box
in the detail section.
Page 1 of 4 has the label not visible
Page 2 of 4 has the label visible
Page 3 of 4 has the label not visible
Page 4 of 4 has the label not visible

If Page 2 is always meeting the condition [Page] = 1 and the default for the
label is visible YES what is the value of [Page] before it gets to page 2?
Or is the condition not being tested on Page 1?
Maybe the sub should be somewhere else and not the PageFooterSection
 
M

Marshall Barton

h2fcell said:
You've been great at pointing out helpful tools to get what I needed done
accomplished. Below you said:
"to determine if the text box will spill over to the next page and the only
way I know
of that can tell you that is the fTextHeight function "

Shouldn't I be able to use the page number of the footer to make that
determination?
I’ve been testing different methods to make a label visible or not from a
“Page Header” section of a report. No Group Sections in this report.
Below is some code I’ve been trying, but I don’t get expected results.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

If [Page] = 1 Then
Me.Label19.Visible = True
Else
Me.Label19.Visible = False
End If

End Sub

Result example:
If a 2 page Report is produced, due to spill over of a memo bound text box
in the detail section.
Page 1 of 2 has the label not visible
Page 2 of 2 has the label visible

If a 4 page Report is produced, due to spill over of a memo bound text box
in the detail section.
Page 1 of 4 has the label not visible
Page 2 of 4 has the label visible
Page 3 of 4 has the label not visible
Page 4 of 4 has the label not visible

If Page 2 is always meeting the condition [Page] = 1 and the default for the
label is visible YES what is the value of [Page] before it gets to page 2?
Or is the condition not being tested on Page 1?
Maybe the sub should be somewhere else and not the PageFooterSection


Page 1 meets the condition and sets the visibility for the
next page header. All other pages will not meet that
condition and so all pages after 2 will not display the
label.

If you will never have more that an single detail in your
report, then you can get away with using this line of code:

Me.Label19.Visible = (Me.Page > 1)

But that line must be in the page HEADER section's Format
event.
 
H

h2fcell

Marsh,
You just showed me the money!
Thank you very much.
I put my code in the "On Format" Event and it worked like a charm.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)

If [Page] = 1 Then
Me.Label19.Visible = True
Else
Me.Label19.Visible = False
End If

End Sub


Marshall Barton said:
h2fcell said:
You've been great at pointing out helpful tools to get what I needed done
accomplished. Below you said:
"to determine if the text box will spill over to the next page and the only
way I know
of that can tell you that is the fTextHeight function "

Shouldn't I be able to use the page number of the footer to make that
determination?
I’ve been testing different methods to make a label visible or not from a
“Page Header†section of a report. No Group Sections in this report.
Below is some code I’ve been trying, but I don’t get expected results.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

If [Page] = 1 Then
Me.Label19.Visible = True
Else
Me.Label19.Visible = False
End If

End Sub

Result example:
If a 2 page Report is produced, due to spill over of a memo bound text box
in the detail section.
Page 1 of 2 has the label not visible
Page 2 of 2 has the label visible

If a 4 page Report is produced, due to spill over of a memo bound text box
in the detail section.
Page 1 of 4 has the label not visible
Page 2 of 4 has the label visible
Page 3 of 4 has the label not visible
Page 4 of 4 has the label not visible

If Page 2 is always meeting the condition [Page] = 1 and the default for the
label is visible YES what is the value of [Page] before it gets to page 2?
Or is the condition not being tested on Page 1?
Maybe the sub should be somewhere else and not the PageFooterSection


Page 1 meets the condition and sets the visibility for the
next page header. All other pages will not meet that
condition and so all pages after 2 will not display the
label.

If you will never have more that an single detail in your
report, then you can get away with using this line of code:

Me.Label19.Visible = (Me.Page > 1)

But that line must be in the page HEADER section's Format
event.
 

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