Reports that are several pages long often have information such as the page number or the date located at the top (header) or bottom (footer) of every page. In this fast and easy lesson you will learn how to use the Page Number command and Date and Time command to add page numbers and/or the current date to your report.
Make sure that you have the rptCustomers report open in Design view.
Here's how to add page numbering to a report:
Select Insert The Page Numbers dialog box appears, as shown in Figure 8-13. The Page Numbers dialog box gives you several choices for how the page numbers can be formatted:
Page N: Prints only the page number (for example, "Page 5.")
Page N of M: Prints the page number and the total number of pages (for example, "Page 5 of 15.")
Select the Page N of M option.
Next you need to specify where on the page you want the page number to appearat the top or bottom of the pageand how you want the page numbers aligned.
Select the Bottom of Page [Footer] option and select Right from the Alignment list.
That's all there is to adding page numbers to a report.
Click OK to close the Page Numbers dialog box.
The Page Numbers dialog box closes, and Access adds a text box with a page number expression (="Page " & [Page] & " of " & [Pages]) to the Page Footer.
Here's how to add the date and time to your reports:
Select Insert The Date and Time dialog box appears, as shown in Figure 8-14. You can specify to add the date, time, or both to your reports. For this exercise, you only want the current date to appear on your report.
Click the Include Time check box to remove its check mark.
Just like the Page Number dialog box, the Date and Time dialog box gives you several choices for how the date and/or time can be formatted. The currently selected date format (the first option) will work fine here so you can close the Date and Time dialog box.
Click OK to close the Date and Time dialog box.
The Date and Time dialog box closes and Access adds a text box with a date number expression [=Date( )] to the Report Header.
Microsoft Access isn't particularly bright and may place the date, time, or page numbers on top of an existing control, as has happened here. To correct the problem you will have to move the new control to a different location on the report.
Click and drag the Date control[=(Date( )] to the far right side of the report header.
Let's see how our modified report looks.
Click the View button on the toolbar.
The report is previewed on the screen, and you can see the date and the page numbering. Now let's save this report and close it.
Click Close, click the Save button, and then close the rptCustomers report.