Lesson 4.8. Changing the Field Size
Figure 4-11. The Field Size property
The Field Size property determines the maximum size of information that can be stored in a text or number field. For example, if you set the size of a text field to 2, you could enter "MN" but not "Minnesota." There are several reasons why you would want to change the size of a field:
Changing the field size reduces data-entry errors.
Access can process smaller field sizes more quickly.
Smaller field sizes require less hard-drive storage space.
Field sizes work a little differently for text and number fields. In text fields, the Field Size property determines the maximum number of characters the field can accept, as shown in Figure 4-11. In numbers fields, the Field Size property determines what type of number the field will accept.
In this lesson you will change the size of a table's fields.
If necessary, open the Lesson 4 database and double-click the tblCustomers table.
In order to change the field size, you must be in Design view.
Click the View button on the toolbar.
The table appears in Design view. You probably already know the first step by nowclick the name of the field whose property you want to change.
Click the State field.
Now change the State's field size.
Click the Field Size box in the Field Properties section and type 2.
The State field can now only accept a maximum of two characters. Users will now have to enter standard two-digit state abbreviations.
Let's try changing the size of another field.
Click the ZipCode field.
Notice that the ZipCode's field size is set at 50. We probably won't have any 50-digit Zip Codes for at least a few more years, so you can safely change the field size to a smaller number.
Click the Field Size box in the Field Properties section and type 11.
The ZipCode field will now accept no more than 11 digits.
Note: Be very careful when you're changing the Field Size of a field that already contains data. Access will truncate or delete data that is larger than the new field size.
Click the Save button on the toolbar to save your changes, click Yes to confirm the change, and close the table.
If you are working with a number field, the Field Size property determines the type and size of the number that a field will accept, as shown in Table 4-3.
Table 4-3. Available Number Field Sizes
0 to 255
-32,768 to 32,767
-2.1x1038 to 2.1x1038
-3.4x1038 to 3.4x1038
-1.8x10308 to 1.8x10308
TO CHANGE THE FIELD SIZE:
MAKE SURE THE TABLE IS DISPLAYED IN DESIGN VIEW.
SELECT THE FIELD WHOSE SIZE YOU WANT TO CHANGE.
CLICK THE FIELD SIZE BOX IN THE FIELD PROPERTIES SECTION.
FOR TEXT FIELDS: TYPE THE FIELD SIZE VALUE.
FOR NUMBER FIELDS: CHOOSE THE VALUE FROM THE LIST.