Home Access 2002 Dates Add Page Numbers & Dates To Reports   |   Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Add Page Numbers & Dates To Reports

 Review The Report

Navigate to the Northwind.mdb database in the Samples subfolder of your Microsoft Office folder. In this tutorial, we’ll make some changes to the reports, so it’s better if you copy Northwind.mdb to the clipboard and paste it in another folder. The new file will be Copy Of Northwind.mdb, which you can then open and use. If you want to work with the original Northwind database, make sure you don’t save the changes when you close the report.

In the Northwind: Database window, click Reports, select Products By Category, and click Preview. If necessary, maximize the report window. Click in the middle of the report to magnify it; use the vertical and horizontal scroll bars to inspect the page fully. The report already has page numbers: The text Page 1 is at the bottom of the page, in the middle. At the bottom left on the scroll bar, click the Last Page button. The report has three pages, and clicking the button takes you to Page 3.

Let’s say that your boss insists the page numbers (a) be in the format Page N Of M (such as Page 7 of 19), so he can be sure no pages are missing, and (b) be displayed at the bottom-left of the report. How can you make these changes?

 Add Page Numbers

Click the View button. Let’s first find the Page Number control. Because page numbers appear on every page, the page number control will be located in either the Page Header or Page Footer section, and because the page numbers are at the bottom of the report, it must be in the Page Footer.

The only control in the footer shows =”Page " & [Pag. This is an expressionthat controls how page numbers are displayed. Part of the expression is missing, however, because it doesn’t fit in the box.

Click the control to select it. Move your pointer to the middle selector handle at the right edge; when it turns to a double arrow, drag it a bit to the right. The full expression is =”Page " & [Page]. That may or may not make sense to you. Fortunately, Access makes it easy to add page numbers in the format you want without knowing anything about what the expression means.

 The Page Numbers Dialog Box

With the control still highlighted, press DELETE to delete the control. Click the Insert menu and then Page Numbers. In the Format section of the Page Numbers dialog box, click the Page N Of M radio button. In the Position section click the Bottom Of Page [Footer] radio button. Click the down arrow button in the Alignment area and review your choices. The meanings of Left, Center, and Right are obvious. The Inside selection will print the page numbers on the left side for pages with odd page numbers and on the right side for pages with even numbers. Outside does the reverse.

Choose Left and click OK. Click View and note the change in the page number text and location. Use the Next Page button on the horizontal scroll bar to view the second and third pages. Close the Products By Category report and click No to reject the changes you made.

 Add A Date

In the Northwind: Database window with Reports selected, choose Orders and click Preview. On the Print Preview toolbar, click the down arrow in the Zoom Box and choose 100%. Using the vertical scroll bar, view the entire report from top to bottom. The date is at the bottom-left corner; click the Next Page button a couple of times to see the date on succeeding pages.

Your boss says you can leave the date at the bottom of each page, but he also wants to see it in the upper-right corner of the first page of the report, across from the Orders title. The format should be dd/mm/yy, for example: 7/23/03. He doesn’t want to know the time.

Click View. Because your boss wants the date opposite the Orders title, the date must appear in the Report Header, which prints once at the beginning of the report.

 Use The Date Dialog Box

Click the Insert menu and then Date And Time. In the Date And Time dialog box, put a check in the Include Date checkbox, and you want the last selection, which is in the format dd/mm/yy. Do not put a check in Include Time. Click OK.

Access adds the control. Can you spot it in Design View? It may be easier to locate in Print Preview. Click View. Access has put the date in the upper-left corner, right above the title Orders.

Click View to return to Design View. The Date control is in the Report Header above the Orders label. It displays the expression =Date().

Your boss wants the date on the right side of the page, so you need to move it. Click the date control to select it. You could drag the control to the right and drop it where you want it. But let’s use the control’s property sheet instead to place it at an exact location in the grid.

Click View and then Properties. Click the Data tab, and the Control Source should be =Date(). Click the Format tab, click in the Left property, and type 5”. The date control will be 5 inches from the Left border. Click in the Top property and type 0.5”. The control will be 0.5 inches from the Top.

Click View. Access has repositioned the date where your boss wants it.

 Add A Date

In the Northwind: Database window with Reports selected, choose Orders and click Preview. On the Print Preview toolbar, click the down arrow in the Zoom Box and choose 100%. Using the vertical scroll bar, view the entire report from top to bottom. The date is at the bottom-left corner; click the Next Page button a couple of times to see the date on succeeding pages.

Your boss says you can leave the date at the bottom of each page, but he also wants to see it in the upper-right corner of the first page of the report, across from the Orders title. The format should be dd/mm/yy, for example: 7/23/03. He doesn’t want to know the time.

Click View. Because your boss wants the date opposite the Orders title, the date must appear in the Report Header, which prints once at the beginning of the report.

 Use The Date Dialog Box

Click the Insert menu and then Date And Time. In the Date And Time dialog box, put a check in the Include Date checkbox, and you want the last selection, which is in the format dd/mm/yy. Do not put a check in Include Time. Click OK.

Access adds the control. Can you spot it in Design View? It may be easier to locate in Print Preview. Click View. Access has put the date in the upper-left corner, right above the title Orders.

Click View to return to Design View. The Date control is in the Report Header above the Orders label. It displays the expression =Date().

Your boss wants the date on the right side of the page, so you need to move it. Click the date control to select it. You could drag the control to the right and drop it where you want it. But let’s use the control’s property sheet instead to place it at an exact location in the grid.

Click View and then Properties. Click the Data tab, and the Control Source should be =Date(). Click the Format tab, click in the Left property, and type 5”. The date control will be 5 inches from the Left border. Click in the Top property and type 0.5”. The control will be 0.5 inches from the Top.

Click View. Access has repositioned the date where your boss wants it.