Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FieldSize Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

                 

You can use the FieldSize property to set the maximum size for data stored in a field set to the Text, Number, or AutoNumber data type.

Setting

If the DataType property is set to Text, enter a number from 0 to 255. The default setting is 50.

If the DataType property is set to AutoNumber, the FieldSize property can be set to Long Integer or Replication ID.

If the DataType property is set to Number, the FieldSize property settings and their values are related in the following way.

SettingDescriptionDecimal precisionStorage size
ByteStores numbers from 0 to 255 (no fractions).None1 byte
DecimalStores numbers from -10^38 -1 through 10^38 -1 (.adp)
Stores numbers from-10^28 -1 through 10^28 -1 (.mdb)
2812bytes
IntegerStores numbers from 32,768 to 32,767 (no fractions).None2 bytes
Long Integer(Default) Stores numbers from 2,147,483,648 to 2,147,483,647 (no fractions).None4 bytes
SingleStores numbers from
3.402823E38 to
1.401298E45 for negative values and from
1.401298E45 to 3.402823E38 for positive values.
74 bytes
DoubleStores numbers from
1.79769313486231E308 to
4.94065645841247E324 for negative values and from 1.79769313486231E308 to 4.94065645841247E324 for positive values.
158 bytes
Replication IDGlobally unique identifier (GUID)N/A16 bytes

You can set this property only from the table's property sheet.

To set the size of a field from Visual Basic, use the DAO property to read and set the maximum size of Text fields (for data types other than Text, the ADO property setting automatically determines the Size property setting).

Note   You can specify the default field sizes for Text and Number fields by changing the values under Default Field Sizes on the Tables/Queries tab, available by clicking Options on the Tools menu.

Remarks

You should use the smallest possible FieldSize property setting because smaller data sizes can be processed faster and require less memory.

Caution   If you convert a large FieldSize setting to a smaller one in a field that already contains data, you might lose data. For example, if you change the FieldSize setting for a Text data type field from 255 to 50, data beyond the new 50-character setting will be discarded.

If the data in a Number data type field doesn't fit in a new FieldSize setting, fractional numbers may be rounded or you might get a Null value. For example, if you change from a Single to an Integer field size, fractional values will be rounded to the nearest whole number and values greater than 32,767 or less than 32,768 will result in null fields.

You can't undo changes to data that result from a change to the FieldSize property after saving those changes in table Design view.

Tip   You can use the Currency data type if you plan to perform many calculations on a field that contains data with one to four decimal places. Single and Double data type fields require floating-point calculation. Currency data type fields use a faster fixed-point calculation.

Show: