The Page Numbers dialog box
The Date and Time dialog box
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 » Page Numbers from the menu.
The Page Numbers dialog box appears, as shown in figure. 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 » Date and Time from the menu.
The Date and Time dialog box appears, as shown in figure. 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.
How to add page numbers:
-
display the report in design view.
-
select insert » page numbers from the menu.
-
select the page-number format, position, and alignment options.
-
click ok.
to insert the date and/or time:
-
display the report in design view.
-
select insert » date and time from the menu. check or uncheck the include date box and select a formatting option.
-
check or uncheck the include time box and select a formatting option.
-
click ok.