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