MS Access

Changing the Field Size

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

The Field Size property

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

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

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

  3. Click the State field.

    Now change the State's field size.

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

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

  6. Click the Field Size box in the Field Properties section and type 11.

    The ZipCode field will now accept no more than 11 digits.

    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.

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

Available Number Field Sizes

Heading Number Range Decimal Places Storage Size

Byte

0 to 255

None

1 byte

Integer

-32,768 to 32,767

None

2 bytes

Long Integer

-2.1x1038 to 2.1x1038

None

4 bytes

Single

-3.4x1038 to 3.4x1038

7

4 bytes

Double

-1.8x10308 to 1.8x10308

15

8 bytes

Replication ID

N/A

N/A

16 bytes


How to change the field size:

  1. make sure the table is displayed in design view.

  2. select the field whose size you want to change.

  3. click the field size box in the field properties section.

  4. for text fields: type the field size value.

    for number fields: choose the value from the list.