MS Access

Adding Page Numbers and Dates

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.

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.

  1. 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.

  2. 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.

  3. 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:

  4. 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.

  5. 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.

  6. 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.

  7. Click and drag the Date control[=(Date( )] to the far right side of the report header.

    Let's see how our modified report looks.

  8. 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.

  9. Click Close, click the Save button, and then close the rptCustomers report.

How to add page numbers:

  1. display the report in design view.

  2. select insert » page numbers from the menu.

  3. select the page-number format, position, and alignment options.

  4. click ok.

to insert the date and/or time:

  1. display the report in design view.

  2. select insert » date and time from the menu. check or uncheck the include date box and select a formatting option.

  3. check or uncheck the include time box and select a formatting option.

  4. click ok.