Controlling the Appearance of Data


There are two vaguely similar field properties that you can use to restrict the data entered in a field or control the way data appears on the screen or when printed. These properties are Format and Input Mask. We will look at the Format property in this topic and at the Input Mask property in the next topic.

You can use the Format property to control the way numbers , dates, times, and text are displayed in tables and on forms and reports . This property controls how the data appears; it does not control how it is stored in the table. The type of formatting you can set varies depending on the data type. Access comes with several predefined formats, and you can specify custom formats for some data types.

In this topic, we ll take a quick look at number formats. If you want more detailed information about text formats ”for example, to see how to use certain symbols to force characters following the symbols to be uppercase or lowercase ”refer to Access s Help feature.

Setting a Predefined Number Format

You can use a custom number format to control exactly how a number will be displayed, with different formats for positive, negative, zero, and null values. A complete description of Access s number format options is beyond the scope of this course, but you can learn more using Access s Help feature.

  1. Display the Employees table in Design view.

  2. Click anywhere in the DateHired field. Then in the Field Properties area, click the Format text box s down arrow to view a list of predefined formats, and select Medium Date in the drop-down list.

    The dates in the table are now displayed in dd-mmm-yy format.

Creating a Custom Number Format

In addition to selecting predefined formats, you can specify custom formats for some data types. Let s create a custom format for the EmployeeID field. Follow these steps to tell Access to always display three digits in this field:

  1. Click anywhere in the EmployeeID field, and then in the Field Properties area, click the Format text box.

  2. Type 000 to tell Access to always display three digits, using leading zeros if the number is less than 100.

    Now if you enter an Employee ID of 36 , Access will display it as 036 .

  3. Click the View button to move to Datasheet view, and save your changes.

    You can now see the results of the custom format in the table.




Online Traning Solutions - Quick Course in Microsoft Office XP
Online Traning Solutions - Quick Course in Microsoft Office XP
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 116

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net