Editing Fields and Their Properties

Team-Fly    

 
10 Minute Guide to Microsoft Access 2002
By Joe Habraken
Table of Contents
Lesson 6.  Editing a Table's Structure

Editing Fields and Their Properties

After you've created a table with the Table Wizard or from scratch, you might find that you want to fine-tune the table's structure. This requires that you edit your fields and their properties.

You can delete fields, add new fields, or change the order of fields in the table. You also can change a field's data type. Because the table's structure is discussed here and not the data, you need to work in the Table Design view.

Caution

Get the Table's Structure Down Before Entering Data You should try to finalize the table's field structure and properties before you enter data. Changing data types or other field properties can actually delete data that you've already entered into the table.


You can open an existing table in the Table Design view in several ways:

  • In the database window, click the Table object icon, select the table you want to work with in the right pane of the database window, and then click the Design button on the database window's toolbar.

  • Right-click the table in the database window and select Design View from the shortcut menu that appears.

  • If you are in the table's Datasheet view, click the View button on the Table Datasheet view toolbar.

Changing Field Names and Data Types

When you are in the Design view (see Figure 6.1), you can enhance or rework your table's structure. For example, you can change a field's name. Just double-click the field's current name and type in a new one.

Figure 6.1. A table's existing structure can be edited in the Design view.

You can also change the data type for an existing field. Click the field's Data Type box and select a new data type from the drop-down list. Remember that when you change a field name or a field's data type, you must save the changes that you've made to the table's structure.

Setting Field Properties

Field properties can also be edited for each field using the various Properties boxes found in the Field Properties pane. Lesson 5, "Creating a Table from Scratch," provides a quick overview of some of the properties that are available.

Another very useful field property, particularly for fields that use text entries (remember that text entries can include numbers ) is an input mask . An input mask is used to format that data as you enter it into a field. For example, you might want to enter a date in a particular format, such as the format xx/xx/xx. The input mask can be used so that when you enter the data into the date field, all you need to enter is the two-digit input for the month, day, and year. Access automatically places the slashes in the field for you.

Plain English

Input Mask A field property that limits the number of characters that can be entered in a field.


Input masks are also very useful for entering ZIP codes. The input mask limits the number of characters that can be entered (such as those in a ZIP code), and if you use the 5-4 ZIP code format, the input mask can place the dash into the ZIP code for you.

To create an input mask for a field (such as a date field or a Design view field), follow these steps:

  1. Click in the Field Name box to select the field for which you want to create the input mask.

  2. In the Field Properties pane, click in the Input Mask box. The Input Mask Wizard button appears in the box.

  3. Click the Input Mask Wizard button to open the dialog box shown in Figure 6.2.

    Figure 6.2. The Input Mask Wizard helps you create an input mask for a field.

  4. The Input Mask Wizard offers a list of possible masks for the field based on the field's data type. For example, Figure 6.2 shows the Input Mask Wizard used for a field with the Date data type. Select one of the mask formats listed, and then click Next .

  5. The next wizard screen shows you the input mask you have chosen and gives you the opportunity to change the format. You can also test the input mask format by typing some data into the Try It box. Edit the input mask format if necessary and then click Next to continue.

  6. You are taken to the last wizard screen. Click Finish to create the input mask. The input mask appears in the Input Mask box in the Field Properties pane (see Figure 6.3).

    Figure 6.3. The input mask appears in the Input Mask box.

  7. Click the Save button to save changes that you have made to the table structure.


Team-Fly    
Top
 


10 Minute Guide to Microsoft Access 2002
10 Minute Guide to Microsoft Access 2002
ISBN: 0789726319
EAN: 2147483647
Year: 2000
Pages: 160
Authors: Joe Habraken

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