Lesson4.11.Formatting Text Fields


Lesson 4.11. Formatting Text Fields

Figure 4-14. The Format property


Just like number, currency, and date/time fields, a text field's Format property changes how information appears in the field. The Format property only changes how data is displayed on screen, not how the data is actually stored in the field.

Unfortunately, unlike number fields, text fields don't have any ready-made settings built into them and must be formatted manually. Luckily, text fields don't have nearly as many formatting options as number, currency, and date/time fields. The most common of these characters are the greater than symbol (>), which makes all text in the field appear in uppercase, and the less than symbol ( ), which makes all text in the field appear in lowercase, regardless of how it was entered. In both cases, Access actually stores the data exactly as it was typed.

This lesson will give you some practice formatting text fields.

  1. If necessary, open the Lesson 4 database.

    Now let's open the tblCustomers table.

  2. Double-click the tblCustomers table.

    First let's enter a sample record using your own personal information.

  3. Click the New Record button on the Record Navigation bar, located at the bottom of the table window.

    Access inserts a new blank record at the bottom of the table.

  4. Press the Tab key and then enter your information into the new record. When you reach the State field, enter the state abbreviation in lowercase letters.

    Move on to the next step when you have finished entering your record into the table.

  5. Click the View button on the toolbar to display the table in Design view.

    Access displays the tblCustomers table in Design view. First you have to click the name of the field you want to format.

  6. Click the State field.

    You can make sure that the contents of the State field are always capitalized by adding a to the Format box.

  7. Click the Format box in the Field Properties section and type a greater than symbol(>).

    Your table should look like Figure 4-14. Access will display the contents of the State field in uppercase, even if it was entered in lowercase.


    Note: Remember that the Format property only changes how data is displayed onscreen, not how the data is actually stored in the field.

  8. Click the Save button on the toolbar to save your changes.

    Now let's see how the State field looks with its new format.

  9. Switch to Datasheet view by clicking the View button on the toolbar.

    Notice that the lowercase state abbreviation you entered back in Step 2 now appears in uppercase.

Table 4-7 contains formatting symbols for text fields.

Table 4-7. General and Text Formatting Symbols

Character

Description

Text

Format

Display

!

Aligns text from the right

Hello

!

Hello

<

Lowercase

Hello

<

hello

>

Uppercase

Hello

>

HELLO

"ABC"

Always displays

4

&" oz."

4 oz.

@

5558000

@@@-@@@@

555-8000

*

Alert

&*!

Alert!!!!!!!!!!

[color]

Displays value in color

Hello

[red]

Hello


QUICK REFERENCE

TO MANUALLY FORMAT A TEXT FIELD:

  1. MAKE SURE THE TABLE IS DISPLAYED IN DESIGN VIEW AND CLICK THE TEXT FIELD YOU WANT TO FORMAT.

  2. CLICK THE FORMAT BOX IN THE FIELD PROPERTIES SECTION.

  3. ENTQR THE APPROPRIATE TEXT FORMATTING SYMBOLS.




CustomGuide Inc - Access 2003 Personal Trainer
Access 2003 Personal Trainer (Personal Trainer (OReilly))
ISBN: 0596009372
EAN: 2147483647
Year: 2005
Pages: 209

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