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

Hide page header & footer on first page

Status
Not open for further replies.

TJones8

Technical User
Apr 16, 2002
77
GB
Does anyone know how i can do a simple thing as hiding page headers & footers only on the first 'title' page of an access 97 report??

TIA if at first you don't succeed, get a 10lb lump hammer
 
There is a property in the Report Properties box that says
PageHeader and you selection is All Pages, Not with Report Header, not with Report Footer, not with Report Header/Footer. You might look at that. If you don't find anything, you can try this. In the Format Event for the PageHeader put
If Me.Page > 1 Then
Me.PageHeaderSection.Visible = True
Else
Me.PageHeaderSection.Visible = False
End If

Paul
 
Thx for this, i tried the PageHeader properties set to not with report header, until i remembered that the reprt header may spill over onto two pages, and i need the page header & footers on every page other than the first.

So then i tried the code only to get an 'invalid qualifier' error and the '.PageHeaderSection' section highligheted.
I changed my page header & footer sections' names to PageHeaderSection and PageFooterSection respectivly as i assumed the code refers to the sections by name. if at first you don't succeed, get a 10lb lump hammer
 
Ok, so i found that i replace 'Me.PageHeaderSection.Visible' with 'Me.Section(&quot;<<NAME OF SECTION>>&quot;).Visible' then it should work.

Only it doesn't.

The only thing i can think of it that once you change a section's property that you need to 'refresh' the current page...
Or am i completely barking?? if at first you don't succeed, get a 10lb lump hammer
 
Well, when I wrote the code, I wasn't entire sure how to name the section so I used the . (dot) method and Access gave me the name (actually it was the same name as my page header). When you type in Me. you should get a dropdown menu with the different Report properties and in that list I had &quot;PageHeaderSection&quot; which was also the name on the Name line in the properties box for the Page Header. Both methods that you outline should work. I did check the code out an it seems to work fine for me. I will double check everything this morning when I have time.

Paul
 
Detail is always Section(0)

Report Header is always Section(1)
Report Footer is always Section(2)

Page Header is always Section(3)
Page Footer is always Section(4)

I thot it was good to know...

[smile]

[pipe]
Daniel Vlas
Systems Consultant
 
Firstly, I am using Access97 in case that makes a difference to reports.
Secondly, could it be something to do with the fact i'm using a page break in the report header?? if at first you don't succeed, get a 10lb lump hammer
 
Ok, i've been prodding and poking and found for some reason, that a page header, but not footer is being displayed on the 2nd page.
So, the fisrt page has neither - which is brilliant, but the second page has only a header, all the rest have both... if at first you don't succeed, get a 10lb lump hammer
 
Well:

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(3).Visible = Me.Page - 1
Me.Section(4).Visible = Me.Page - 1
End Sub

That works peachy here...


Good luck

[pipe]
Daniel Vlas
Systems Consultant
 
Dan's code should do it for Header and Footer. I only posted a solution for the Header thinking you would just copy that over to deal with the Footer.

Paul
 
Paul, i did just copy the code into the format event of the footer, and alter it for the footer of cause ;)

There must be something wrong with my report because using Dan's code displays the header when it should and hides it when it should, but always displays the footer...

I'm going to create a completly new database and try a report in there just in case it isn't just this db that's somehow become screwed...

Thx for the persistance peeps.. if at first you don't succeed, get a 10lb lump hammer
 
OK then, it works fine in a completely clean db.
EXCEPT!!
when i add a report header & footer.

So then, report headers and footers are a bad thing for me.

/me is off to figure out a way to get a 'title page' without report headers or footers... if at first you don't succeed, get a 10lb lump hammer
 
TJones, add a text box in the page footer:
=[Page] & &quot; of &quot; & [Pages]
If you don't need it, make it invisible.

As I said, it works peachy here...
ftp://ftp.artrom.ro/RptHdFt.mdb
(it's Access 97, but you can convert it to whatever access version)
Download it and open the report

Good luck

[pipe]
Daniel Vlas
Systems Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top