Adding page headers, footers, and numbers
To add Report or Page Header or Footer sections, click the Report Header/Footer button on the Show/Hide group of the Arrange tab on the Ribbon. You can also right-click anywhere in the Report Design window and select Report Header/Footer from the context menu. Access adds these in pairs: If you have a Page Header, you have a Page Footer. You can leave one or the other blank, though. To delete the Page or Report Header or Footer sections, choose the same command again: Access deletes the Header/Footer pair and all the controls in the sections.
If you want just a header or just a footer, change the height of the section you want to hide by dragging the bottom border of the section up to the top border.
Adding page numbers
After you have a Page Header or Footer to put controls in, you can create controls in those sections, or drag them there from other sections. The easiest way to add page numbers - probably one of the most common controls you find in a report - is to click the Insert Page Numbers button on the Controls group of the Design tab on the Ribbon. When you see the Page Numbers dialog box, choose the format of the numbering, the position, and the alignment (Left, Center, Right, Inside, or Outside). Inside and Outside page numbering refers to alternating left and right positions on odd and even pages. You can also omit the page number on the first page by deselecting the Show Number on First Page check box.
If you'd rather make your own page-numbering controls, you can create your own text box control by following these steps:
- With the report open in Design view, display the Design tab on the Ribbon.
- Create a text box control in the Page Header or Footer section by
clicking the Text Box button on the Controls group of the Design tab
on the Ribbon, and clicking in the header or footer section.
Don't worry if the text box doesn't appear in exactly the right place - you can drag it there later.
- If Access created a label to go with the text box, delete the label by clicking in the label and then pressing the Delete key.
Your page number doesn't need a label.
- Display the Property sheet if it's not already on-screen by clicking the
Property Sheet button on the Tools group of the Design tab on the Ribbon.
You see the Property sheet with the properties of the text box you just created.
- Click the Data tab on the Property sheet, click in the Control Source property, and type the following expression:
To display the word Page as well as the number, type
= "Page " & Page
Adding the date and time
If you want to include the current date or time on your report, follow the same steps as in the preceding section, but type the following expression into the Control Source property of another text box:
The Now() function returns both the date and time (for example, 6/25/04 1:55:48 PM). If you want to print only the current date, format the box as a date using the Format property. (In the Property sheet for the text box, click the Format tab and set the Format property to one of the date formats, which omit the time.)
Controlling which pages get page headers and footers
You can also choose whether the Page Header and Footer sections print on all pages, all but the Report Header page (so your cover page isn't numbered), all but the Report Footer page, or all but the Report Header and Footer pages. The following steps explain how to change the Page Header and Footer sections properties:
- With the report open in Design view, double-click the report selector
(the gray box in the top-left corner of the Design window, where the
rulers intersect) or right-click the title bar of the Design View window
and choose the Properties option.
You see the Property sheet for the report.
- Click the Format tab.
- Set the Page Header and Page Footer properties.
Your options are All Pages, Not With Rpt Hdr, Not With Rpt Ftr, and Not With Rpt Hdr/Ftr.
Displaying the first value of a field in the Page Header section to make a telephone-book-style header is easy. Just create a text box in the Page Header section that displays the field. When you print the report, the text box shows the value for the first record on the page. You can also print the value of the last record on the page in the Page Footer section.
In this tutorial:
- Creating and Editing Reports
- What are Forms and Reports
- Creating Reports Automatically
- Running the Report Wizard
- Creating Simple Reports
- Editing Reports in Design View
- Adding page headers, footers, and numbers
- Adding sections that group your records
- Sorting the records in your report
- Calculating group subtotals and report totals
- Formatting Tips and Tricks
- Copying Forms to Reports
- Adding and Formatting Subreports
- Displaying Empty or Long Fields
- Creating Mailing Labels