Putting report footer at bottom of page

  • Thread starter Thread starter dellpete
  • Start date Start date
D

dellpete

Guest
In Access 97 until 2000, you don't have a property to instruct Access to put the report footer at the bottom of the page.
Does anyone knows if Access 2003 has this possibility (like for example Chrystel Reports has)?
I am now putting information at the page footer and use the Visible function with Page and Number of Pages, to print this information only on the last page. But this is always a lot of work and the used space can not be used for detail information.
Another method is to calculate the space needed by using the number of lines in the detail area, but whenever you change something you have to check/change this.

If Access 2003 does not have this option, but there is an easier way way to accomplish this, I would very much appreciate it to get to know this method.

Peter
 
If I understand you correctly, you only want to print the page number on the last page of your report. To do this, place the fields in the Report Footer.

If you want them to print on each page, place them in the page footer.
 
Can be done with a little VBA

I was wondering about this, too. Then it occurred to me that thanks to the "Pages" property of reports, it can be done with a little VBA script.

Steps:

View the code from your report.

Paste this in and save:

Code:
Function DisplayReportFooter()

Dim strFooter

'replace the quoted text with your footer
strFooter = "my report footer text" 

If Me.Page = Me.Pages Then
     DisplayReportFooter = strFooter
Else
      DisplayReportFooter = ""
End If

End Function

Create a text box in your PAGE footer. This will be where the text you entered in the function above will appear on the last page of your report.

Set the "control source" property of the text box to:

Code:
=DisplayReportFooter()

Optionally, set the "can shrink" property to "yes".

Save, and then preview your report. Go to the last page. At the bottom, you should see whatever text you entered in the function. ("my report footer text" or whatever.)

It's not an ideal solution, but it's not bad.

If you already know VBA, it would only take two seconds to change the function so that you can use it globally, and just pass in the string you want to show up in the footer:

Change the function to:
Code:
Function DisplayReportFooter(strFooter)

'if the current page is the last page, then...
If Me.Page = Me.Pages Then
     DisplayReportFooter = strFooter
Else
      DisplayReportFooter = ""
End If
        
End Function

If you put this function in a global module, you have to pass it a report object instead of the much easier "Me" object, but you get the idea.

Good luck!

ADM
thousandrobots.com
 

Users who are viewing this thread

Back
Top Bottom