Table Fields.
You can use the FieldSize property to set the maximum size of data that can be stored in a field set to Text or Number data type.
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 Number, the FieldSize property settings and their values are related in the following way.
|
|
Decimal Precision |
Storage Size |
Byte |
Stores numbers from 0 to 255 |
None |
1 byte |
Integer |
Stores numbers from -32,768 to 32,767 (no fractions). |
None |
2 bytes |
Long Integer |
(Default) Stores numbers from |
None |
4 bytes |
Single |
Stores numbers from |
7 |
4 bytes |
Double |
Stores numbers from |
15 |
8 bytes |
ReplicationID |
Globally Unique Identifier (GUID) |
N/A |
16 bytes |
You can set this property in the table’s property sheet or using Visual Basic.
In Visual Basic, use the Data Access Object’s Size property to read and set the maximum size of text fields (for data types other than Text, the Type 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 the Default Field Sizes option on the Tables/Queries tab, available by clicking Options on the Tools menu.
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 in the field. For example, if you change the FieldSize setting for a Text data type field from 255 to 50, data beyond the 50 characters 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 Single to Integer data type, 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 a table’s design after saving it 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.
DecimalPlaces Property, Size Property (Microsoft Office 95 Data Access Reference).