suppress page footer after first page

L

Lijo

The following codes help me to print texts in first page. That's perfect.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Line49.Visible = (Me.Page = 1)
Me.Line50.Visible = (Me.Page = 1)
Me.Line51.Visible = (Me.Page = 1)
End Sub

From 2nd page onwards the page footer space is blank. But I would like to
use it for printing records listed in detail section. Is there any way?

Please help
 
M

Marshall Barton

Lijo said:
The following codes help me to print texts in first page. That's perfect.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Line49.Visible = (Me.Page = 1)
Me.Line50.Visible = (Me.Page = 1)
Me.Line51.Visible = (Me.Page = 1)
End Sub

From 2nd page onwards the page footer space is blank. But I would like to
use it for printing records listed in detail section. Is there any way?

Then you don't need that code. Instead, add a line of code
to the page header section's Format event:

Me.Section(4).Visible = Me.Page > 1
 
L

Lijo

Thank you for the reply.

I think, i did not specify all. Sorry for that. The below 3 points tell
all about page footer.

1. The lines I specified below is for making some boxes.
2. And inside boxes there are some text boxes(12 nos.) with code like :
=IIf([Page]=1,"MY / " & [Enter Originators],"")
3. Below the boxes with lines there is text box showing page number, need to
be displayed on each page.

Here I do not want to display point 1 and 2 after 1st page. The same time I
need to use the space for detail section.

Please help me.
 
M

Marshall Barton

To make part of the space in the page footer available for
data (after the first page), you nould have to use the page
header section's event to move the controls up to the
desired location in the footer section. The controls you
are making invisible should be moved to the top of the
section. After the the footer section has nothing in it's
lower area, then you can change the Height of the page
footer section.

The code would be roughly along these lines:
If Me.Page =2 Then
Me.Line49.Visible = False
Me.Line49.Top = 0
Me.Line50.Visible = False
Me.Line50.Top = 0
Me.Line51.Visible = False
Me.Line51.Top = 0

Me.sometextbox1.Top = 0
. . .
Me.sometextbox12.Top = 0

Me.pagetextbox.Top = 0
Me.Section(4).Height = Me.pagetextbox.Height
End if
--
Marsh
MVP [MS Access]

I think, i did not specify all. Sorry for that. The below 3 points tell
all about page footer.

1. The lines I specified below is for making some boxes.
2. And inside boxes there are some text boxes(12 nos.) with code like :
=IIf([Page]=1,"MY / " & [Enter Originators],"")
3. Below the boxes with lines there is text box showing page number, need to
be displayed on each page.

Here I do not want to display point 1 and 2 after 1st page. The same time I
need to use the space for detail section.


Marshall Barton said:
Then you don't need that code. Instead, add a line of code
to the page header section's Format event:

Me.Section(4).Visible = Me.Page > 1
 
L

Lijo

I tried with the following code :
============
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Line49.Visible = (Me.Page = 1)
Me.Line50.Visible = (Me.Page = 1)
Me.Line51.Visible = (Me.Page = 1)
Me.Line52.Visible = (Me.Page = 1)
Me.Line53.Visible = (Me.Page = 1)
Me.Line55.Visible = (Me.Page = 1)
End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Text136.Visible = True
Me.Text16.Visible = True
Me.Text17.Visible = True
Me.Text138.Visible = True
Me.Text139.Visible = True
If Me.Page > 1 Then
Me.Line49.Visible = False
Me.Line49.Top = 0
Me.Line50.Visible = False
Me.Line50.Top = 0
Me.Line51.Visible = False
Me.Line51.Top = 0
Me.Line52.Visible = False
Me.Line52.Top = 0
Me.Line53.Visible = False
Me.Line53.Top = 0
Me.Line55.Visible = False
Me.Line55.Height = 0
Me.Text136.Height = 0
Me.Text136.Visible = False
Me.REMARKS.Height = 0
Me.Text16.Visible = False
Me.Text16.Height = 0
Me.txtOriginator.Height = 0
Me.Label54.Height = 0
Me.Text135.Height = 0
Me.Text65.Height = 0
Me.Label56.Height = 0
Me.Text17.Height = 0
Me.Text138.Height = 0
Me.Text139.Height = 0
Me.Text141.Height = 0
Me.Label1.Top = 0
Me.Section(4).Height = Me.Label1.Height
End If
End Sub
============
But, from 2nd page onwards, space of page footer section is still blank.
Also, some texts disappeared in the page footer section of first page.

Kindly advice....

Thanks

Marshall Barton said:
To make part of the space in the page footer available for
data (after the first page), you nould have to use the page
header section's event to move the controls up to the
desired location in the footer section. The controls you
are making invisible should be moved to the top of the
section. After the the footer section has nothing in it's
lower area, then you can change the Height of the page
footer section.

The code would be roughly along these lines:
If Me.Page =2 Then
Me.Line49.Visible = False
Me.Line49.Top = 0
Me.Line50.Visible = False
Me.Line50.Top = 0
Me.Line51.Visible = False
Me.Line51.Top = 0

Me.sometextbox1.Top = 0
. . .
Me.sometextbox12.Top = 0

Me.pagetextbox.Top = 0
Me.Section(4).Height = Me.pagetextbox.Height
End if
--
Marsh
MVP [MS Access]

I think, i did not specify all. Sorry for that. The below 3 points tell
all about page footer.

1. The lines I specified below is for making some boxes.
2. And inside boxes there are some text boxes(12 nos.) with code like :
=IIf([Page]=1,"MY / " & [Enter Originators],"")
3. Below the boxes with lines there is text box showing page number, need to
be displayed on each page.

Here I do not want to display point 1 and 2 after 1st page. The same time I
need to use the space for detail section.


Marshall Barton said:
Lijo wrote:
The following codes help me to print texts in first page. That's perfect.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Line49.Visible = (Me.Page = 1)
Me.Line50.Visible = (Me.Page = 1)
Me.Line51.Visible = (Me.Page = 1)
End Sub

From 2nd page onwards the page footer space is blank. But I would like to
use it for printing records listed in detail section. Is there any way?

Then you don't need that code. Instead, add a line of code
to the page header section's Format event:

Me.Section(4).Visible = Me.Page > 1
 
M

Marshall Barton

Lijo said:
I tried with the following code :
============
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Line49.Visible = (Me.Page = 1)
Me.Line50.Visible = (Me.Page = 1)
Me.Line51.Visible = (Me.Page = 1)
Me.Line52.Visible = (Me.Page = 1)
Me.Line53.Visible = (Me.Page = 1)
Me.Line55.Visible = (Me.Page = 1)
End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Text136.Visible = True
Me.Text16.Visible = True
Me.Text17.Visible = True
Me.Text138.Visible = True
Me.Text139.Visible = True
If Me.Page > 1 Then
Me.Line49.Visible = False
Me.Line49.Top = 0
Me.Line50.Visible = False
Me.Line50.Top = 0
Me.Line51.Visible = False
Me.Line51.Top = 0
Me.Line52.Visible = False
Me.Line52.Top = 0
Me.Line53.Visible = False
Me.Line53.Top = 0
Me.Line55.Visible = False
Me.Line55.Height = 0
Me.Text136.Height = 0
Me.Text136.Visible = False
Me.REMARKS.Height = 0
Me.Text16.Visible = False
Me.Text16.Height = 0
Me.txtOriginator.Height = 0
Me.Label54.Height = 0
Me.Text135.Height = 0
Me.Text65.Height = 0
Me.Label56.Height = 0
Me.Text17.Height = 0
Me.Text138.Height = 0
Me.Text139.Height = 0
Me.Text141.Height = 0
Me.Label1.Top = 0
Me.Section(4).Height = Me.Label1.Height
End If
End Sub
============
But, from 2nd page onwards, space of page footer section is still blank.

You can not make a section smaller than the bottom of any
control. This means that *every* control below Label1 must
have its Top and Height adjusted to make it above the bottom
of Label1.
Also, some texts disappeared in the page footer section of first page.

I suspect this is happening because you are using the Pages
property somewhere in the report. That causes the report to
be processed (at least) two times and the second time
around, the first page is using the settings that were in
place on the last page the first time around. Typically,
this issue is resolved by using the first page's Page Header
to set the properties as needed on the fiest page.

Once set for page 2, the settings will remain in effect for
the remainder of the pages so there is no benefit from
setting all those properties on every page.

Try using this kind of code in the Page Header Print event
procedure (and delete the page footer code):

Private Sub PageHeaderSection_Format( . . .
Select Case Me.Page
Case 1 'replace these numbers with your real values
Me.Section(4).Height = 4320
Me.Line49.Visible = True
Me.Line49.Top = 200
Me.Line50.Visible = True
Me.Line50.Top = 400
Me.Line51.Visible = True
Me.Line51.Top = 600
Me.Line52.Visible = True
Me.Line52.Top = 800
Me.Line53.Visible = True
Me.Line53.Top = 1000
Me.Line55.Visible = True
Me.Line55.Height = 1200
Me.Text136.Top = 400
Me.Text136.Height = 200
Me.Text136.Visible = True
Me.REMARKS.Height = 500
Me.Text16.Top= 600
Me.Text16.Visible = True
Me.Text16.Height = 300
Me.txtOriginator.Top = 600
Me.txtOriginator.Height = 300
. . .
Me.Label1.Top = 3456
Case 2
Me.Line49.Visible = False
Me.Line49.Top = 0
Me.Line50.Visible = False
Me.Line50.Top = 0
Me.Line51.Visible = False
Me.Line51.Top = 0
Me.Line52.Visible = False
Me.Line52.Top = 0
Me.Line53.Visible = False
Me.Line53.Top = 0
Me.Line55.Visible = False
Me.Line55.Height = 0
Me.Text136.Top = 0
Me.Text136.Height = 0
Me.Text136.Visible = False
Me.REMARKS.Top = 0
Me.REMARKS.Height = 0
Me.Text16.Top= False
Me.Text16.Visible = False
Me.Text16.Height = 0
Me.txtOriginator.Top = 0
Me.txtOriginator.Height = 0
. . .
Me.Label1.Top = 0
Me.Section(4).Height = Me.Label1.Height
End Select

Note that in VBA code, you must specify the Top, Height, etc
in twips, not in inches or centimeters (here are 1440 twips
per inch). Instead of manually converting inches to twips
you can use expressions like:
Me.Section(4).Height = 3 * 1440 ' 3 inches
 

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