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

Page Footer only on last page? 3

Status
Not open for further replies.

CompAnalyst

Programmer
Nov 11, 2003
33
US
Anyone know how to make the Page Footer only appear on the last page of a report? And I can't use Report Footer.....
thx!
 
In the Format Event for the Page Footer you can try
Me.PageFooter.Visible = Me.Page = Me.Pages

Paul
 
Paul, your solution is just so, so tautalogical. I'm moved.
 
add this code to the pagefooter

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

Cancel = ([Page] <> [Pages])

End Sub
 
WOOHOOO! Thanks drctx! That one worked! Couldn't get your version to work... kept gettin errors PaulBricker... Thank you though!
 
I'll give drctx a star for that. I had to adjust mine to

Me.PageFooterSection.Visible = Me.Pages

That seemed to do it.

Paul
 
Thanks again guys... i really do appreciate it! I am sure i will be back with more questions :p
 
ARGH... still not working... I thought at first it was but alas it isnt... i tried both methods. :(
 
Where are you running the code? It should be in the format event for the Page Footer.

Paul
 
Me.PageFooter.Visible = Me.Page = Me.Pages
shouldn't this be

Me.PageFooter.Visible = (Me.Page = Me.Pages)
 
PaulBricker, I tried your code in the format event and it would give me errors (Invalid Qualifier- in reference to ReportFooter).. the code is sitting in the On Format event in the Page Footer.
vbajock- I put your code in and its still showing the footer on the 2nd and 3rd pages (of the report).

Just to give you a bit of background this report generates job descriptions which are loaded onto a website.... the signature section needs to be on the bottom of the last page, but because the length of the report footer is variable based on the data that populates it (min requirements for hire), it's kinda tricky. Make sense?
 
One more try:

Me.PageFooter.Visible = iif(Me.Page = Me.Pages,true,false)
 
Sigh.... not so much... footer still appearing on the 2nd and 3rd pages (3 total pages). Maybe i should just scrap it and write the report over (I was not the original writer).... but wouldnt the same problem exist if I want that signature section snapped to the bottom of the last page?

Thank you again for your help :)
 
Ok, now I'm beginning to think you are executing some other code somewhere.
Me.PageFooter.Visible = iif(Me.Page = Me.Pages,true,false)
is pretty explicit.
 
You have to have a reference to the Page and Pages properties on your report. You can add a textbox to the Page footer that has a control source set to

=&quot;Page &quot; & Page & &quot; of &quot; & Pages

You can set the visible property to No if you don't want to see it. Then you can use

Cancel = Me.Page <> Me.Pages

in the Format event for the PageFooter. Try that and see if it works. It worked for me on a large report.

Paul

 
let's see.... um.... as far as other code... the only thing that i think might be odd is the PageFooter property of the form might be set incorrectly... right now it is set as &quot;Not with rpt header&quot;. Other than that... i can't see why it wouldn't work.... :(
 
OOOOOOH PaulBricker, you superstar it WORKED!!!!! Thank you thank you thank you!!!!! I have no idea why the other ways didn't work.... BUT YOURS DID!!!!! GOOOOOOOOOOOOO TEAM!!!!! RAH RAH!

Rachel
 
I'm a bit surprised myself. Last night a reference to
Me.PageFooterSection.Visible worked. Tonight it didn't. But I did discover that the Pages property doesn't work unless you set a reference to it using it in a textbox. Very strange but it's Access. Go figure.

Paul
 
ya that access is pretty darn weird at times... but thank god for the internet.... so i can ask people who know more than i do for help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top