Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 9: Presenting Data with Access Reports


353


Entering an expression in a text control
Expressions enable you to create a value that is not already in a table or query. They can range
from simple functions (such as a page number) to complex mathematical computations.

Cross-Reference
Chapter 5 discusses expressions in greater detail.


A function is a small program that, when run, returns a single value. The function can be one of
many built-in Access functions or it can be user defined.

The following steps show you how to use an unbound text box to add a page number to your
report:


  1. Click in the middle of the Page Footer section, and resize the page footer so that it is^1 ⁄ 2
    inch in height.

  2. Drag a text-box control from the Controls group on the Design ribbon tab and drop it
    into the Page Footer area. Make the text box about three-quarters of the height of the
    Page Footer section and about^1 ⁄ 2 inch wide.

  3. Select the text box’s attached label and change its contents to say Page:.

  4. Select the text box control (it says “Unbound”) and enter = Page directly into the text
    box.


Alternatively, you could open the Property Sheet (press F4) and enter = [Page] as the text
box’s ControlSource property.



  1. Drag the new text-box control until it’s near the right edge of the report’s page, as shown
    in Figure 9.30.


You may want to also move the text box’s label so that it’s positioned close to the text
box. The upper-left handle on the label moves the label independently of the text box.


FIGURE 9.30
Adding a page-number expression in a text-box control
Free download pdf