Applies ToAccess for Microsoft 365 Access 2024 Access 2021 Access 2019 Access 2016

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.

Top of Page

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

  1. Open the table in Datasheet View.

  2. If necessary, scroll horizontally to the first blank field.

  3. Double-click the header row, and then type a name for the new field.

  4. Select Click to Add and then select Number, Large Number, or Currency from the list.

  5. Double-click the new header row, and then type a meaningful name for the new field.

  6. Save your changes.

Add to a new table

  1. On the Create tab, in the Tables group, click Table.

  2. Click Save, and in the Save As dialog box, enter a name for the new table.

  3. Select Click to Add and then select Number, Large Number, or Currency from the list.

  4. Double-click the new header row, and then type a meaningful name for the new field.

  5. Save your changes.

Top of Page

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

  1. Open the table in Design View.

  2. In the Field Name column, select the first blank row, and then type a name for the field.

  3. Select the adjacent cell in the Data Type column, and then select Number, Large Number, or Currency from the list.

  4. Save your changes.

Add to a new table

  1. On the Create tab, in the Tables group, click Table.

  2. Click Save, and in the Save As dialog box, enter a name for the new table.

  3. Right-click the document tab for the new table and click Design View.

  4. In the Field Name column, select the first blank row and type a name for the field.

  5. Select the adjacent cell in the Data Type column, and then select Number, Large Number, or Currency from the list.

  6. Save your changes.

Top of Page

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.

  1. Open the table in Design View.

  2. On the General tab in the lower section of the table designer, under Field Properties, locate the property that you want to change.

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

Top of Page

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

  1. Open the table in Datasheet View.

  2. Locate the Number field, right-click the header row (the field name), and then click Delete Column.

  3. Click Yes to confirm the deletion.

Delete in Design view

  1. Open the table in Design View.

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

  3. Click Yes to confirm the deletion.

Top of Page

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:

  • No     Turns off indexing (default).

  • Yes (Duplicates OK)     Indexes the field and allows duplicate values. For example, you may have duplicate first and last names.

  • Yes (No Duplicates)     Indexes the field and does not allow duplicate values that is, all values are unique.

Text Align

Specifies the alignment for data:

  • General     Aligns text to the left, numbers and dates to the right (default setting).

  • Left     Aligns all text, dates, and numbers to the left.

  • Right     Aligns all text, dates, and numbers to the right.

  • Center     Centers all text, dates, and numbers.

  • Distribute     Justifies all text, dates, and numbers evenly against both sides of the field or text box.

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.