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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Page Footer on Page 1 ONLY

Status
Not open for further replies.

cygnut

Programmer
Oct 31, 2002
14
Need help to customize a report to show page footer on 1st Page only. Starting from page 2 and so on, no page footer and the Detail section will expand and take over the space.
 
Put this in the on format event of the page footer.

If Me.Page = 1 Then
Me.PageFooterSection.Visible = True
Else
Me.PageFooterSection.Visible = False
End If
 
Okay, so i tested this after I posted. And I found out that it doesn't work. But relax, I've got the solution now. Just put this code in your On Format event of the footer section.

Cancel = (Me.Page <> 1)

 
Lets clarify,

Still using Access 97.
Put the code in PageFooter_Format
like that:

if page = 1 then
me.section(4).Visible = True
else
me.section(4).Visible = False
endif

IT does not works on me.

Next step is how to expand the detail section while on page 2, which will only conatin a Text Box for memo field.
 
Oh, the code in that last post also assumes that you have used the Page variable in your footer. So if you don't already have something that displays &quot;Page 1 of 10&quot;, then just create a text box in the footer, make it invisible, and put this as the control source:

=&quot;Page &quot; & [Page] & &quot; of &quot; & [Pages]
 
To expand the details section, just set the Can Grow property for the section to Yes. But also be sure to Can Grow property for your text box to Yes as well. Otherwise if the memo is longer than the size of the text box, then it wouldn't display it on the page. So lets recap every thing now.

To make the footer only show on the first page, just put this in the On Format event of your page footer:
Cancel = (Me.Page <> 1)
(this is all the code you should need)

Properties to set for the Details section:
Can Grow should be Yes

Properties to set for the Text Box for memo:
Can Grow should be Yes


 
Thanks for your idea on

Cancel = (Page <> 1)

It works to print page footer on page 1 only.

BUT, the detail section still the same size of page 1, even I set to can grow to YES and can shink to NO.

The Page footer is only an empty space.

????
 
I don't know if this will work for you or not, but could you use the Report Footer instead of the page footer? The detail section will utilize the report footer's space after page 1......

Hoc nomen meum verum non est.
 
Ignore my previous post....I combined information from two threads into this one and it's obviously WRONG!!!

Hoc nomen meum verum non est.
 
Someting Funny, seems works but still have some issue:

With This Code
===============

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
Cancel = (Page <> 1)
End Sub


Private Sub Report_Page()
If Page >= 1 Then
Me.Section(4).Visible = False
Me.Section(0).Controls.Item(11).Height = 9576
End If
End Sub

=================
Remarks:
.Height = 9576 is the max. of detail section while using LANDSCAPE LETTER PAPER.


This routing works OK on initial Preview.

Funny things are
================
Works on First View

Previewing and scrolling page to page until last page.
Scroll Back to page 1, all format lost.

If I just goes for Print, no preview, output is exactly what I wants.

Is there a event for end of pages, so I can restore back the initial setting of the report page / header.
 
Instead of starting a new thread, although one may be needed, I have a similar situation.

I need to have the page header to not print on the last page of a variable length report.

In the Report footer I have images that need to be printed with every report generated but the page header also prints on that page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top