You add a Number or Currency field to a table when you need to store numeric data, such as sales and revenue figures or population data. Consider also the optimum field size and additional properties (such as decimal places, uniqueness, and whether required) when creating numeric data.
In this article
Understand Number and Currency fields
You use a Number field for all mathematical calculations including money and those that require a high degree of accuracy, or for figures that you don't want to round up or down. The size of the values that you store in a Number or Currency field depends on how you set the Field Size property. For example, you can set fields to contain 1-byte, 2-byte, 4-byte, 8-byte, or 16-byte values, plus Replication IDs (globally unique identifier values, or GUIDs) and decimal values. The following table lists the values that each Field Size setting can contain and explains when to use each size setting.
Field Size setting |
Description |
---|---|
Byte |
A 1-byte integer containing values from 0 to 255. |
Integer |
A 2-byte integer containing values from -32,768 to +32,767. |
Long Integer |
A 4-byte integer containing values from -2,147,483,648 to 2,147,483,647. |
(Not applicable) |
An 8 byte integer containing values from -2^31 to 2^31-1 |
Single |
A 4-byte integer containing values from -3.4 x 1038 to +3.4 x 1038 and up to 7 significant digits. |
Double |
An 8-byte floating point number containing values from -1.797 x 10308 to +1.797 x 10308 and up to 15 significant digits. |
Replication ID |
A 16-byte globally unique identifier (GUID). Randomly generated GUIDs are long enough that they are not likely to overlap. You use them for a variety of applications, such as tracking goods. |
Decimal |
A 12-byte integer with a defined decimal precision that can contain values from -1028 to +1028. The default precision is 0. The default scale (the number of decimal places displayed) is 18. You can set the scale up to 28. |
Add a Number or Currency field in Datasheet view
You can add a number or currency field to a new or existing table in Datasheet View.
Add to an existing table
-
Open the table in Datasheet View.
-
If necessary, scroll horizontally to the first blank field.
-
Double-click the header row, and then type a name for the new field.
-
Select Click to Add and then select Number, Large Number, or Currency from the list.
-
Double-click the new header row, and then type a meaningful name for the new field.
-
Save your changes.
Add to a new table
-
On the Create tab, in the Tables group, click Table.
-
Click Save, and in the Save As dialog box, enter a name for the new table.
-
Select Click to Add and then select Number, Large Number, or Currency from the list.
-
Double-click the new header row, and then type a meaningful name for the new field.
-
Save your changes.
Add a Number or Currency field in Design view
You can add a number or currency field to a new or existing table in Design View.
Add to an existing table
-
Open the table in Design View.
-
In the Field Name column, select the first blank row, and then type a name for the field.
-
Select the adjacent cell in the Data Type column, and then select Number, Large Number, or Currency from the list.
-
Save your changes.
Add to a new table
-
On the Create tab, in the Tables group, click Table.
-
Click Save, and in the Save As dialog box, enter a name for the new table.
-
Right-click the document tab for the new table and click Design View.
-
In the Field Name column, select the first blank row and type a name for the field.
-
Select the adjacent cell in the Data Type column, and then select Number, Large Number, or Currency from the list.
-
Save your changes.
Set or change Number or Currency field properties
You can use Datasheet View to set a subset of field properties, such as Is Required or Unique, but use Design View to set all available properties, includingInput Mask or Caption.
-
Open the table in Design View.
-
On the General tab in the lower section of the table designer, under Field Properties, locate the property that you want to change.
-
Select the field next to the property name. Depending on the property, you enter data (such as default text or an input mask), start the Expression Builder by clicking ..., or select an option from a list.
For information about how to use each field property, select the property and then press F1.
Delete a Number or Currency field
Important When you delete a Number field that contains data, you lose that data permanently — you cannot undo the deletion. For that reason, you should back up your database before you delete any table fields or other database components.
Delete in Datasheet view
-
Open the table in Datasheet View.
-
Locate the Number field, right-click the header row (the field name), and then click Delete Column.
-
Click Yes to confirm the deletion.
Delete in Design view
-
Open the table in Design View.
-
Click the row selector (the blank square) next to the Number field, and then press DELETE, or right-click the row selector, and then click Delete Rows.
-
Click Yes to confirm the deletion.
Number and Currency field property reference
When you use Design view to add a Number or Currency field to a table, you can set and change several properties for the field. This table lists and describes the Number and Currency field properties and explains the implications of setting or changing them.
Property |
Usage |
---|---|
Field Size |
Controls the size of the value that you can enter and store in the field. |
Format |
You enter custom formatting characters to define a display format. Formats defined here appear in datasheets, forms, and reports. |
Decimal Places |
Sets the number of decimal places for the values in the field. Default value: Auto. Other possible values range from 0 to 15. |
Input Mask |
You define an input mask when you need to control how users enter data in the field. For more information about using input masks, see the article Create an input mask to enter field or control values in a specific format. |
Caption |
Specifies the name of your Text field. This property accepts up to 2,048 characters. If you don't specify a caption, Access applies the default field name. |
Default Value |
Specifies the value that automatically appears in a field when you create a new record. |
Validation Rule |
Specifies the requirements for data entered into an entire record, an individual field, or a control. When users enter data that violates the rule, you can use the Validation Text property to specify the resulting error message. Maximum length: 2,048 characters. For more information about creating validation rules, see the article Create a validation rule to validate data in a field. |
Validation Text |
Specifies the text in the error message that appears when users violate a validation rule. Maximum length: 255 characters. For more information about creating validation rules, see the article Create a validation rule to validate data in a field. |
Required |
When this property is set to Yes, you must enter a value in the field or in any controls bound to the field. In addition, the value cannot be null. |
Indexed |
You use an index to speed up queries, sorting, and grouping operations run against large amounts of data. You can also use indexes to prevent users from entering duplicate values. Choices:
|
Text Align |
Specifies the alignment for data:
|