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.
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:
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.
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: