Working with Tables

Close Window 

Data Types

The Data Type is a field property that determines what kind of data a field can store. You assign a Data Type to a field when you create it. You can only assign one Data Type to a field. This table summarizes the Data Types and what youíd use them for.

Data Type

What It Stores

Text

Text, numbers, or any combination of the two, up to a maximum of 255 characters. Use a Text field for text or numbers that you wonít use in mathematical calculations (Zip codes and telephone numbers, for example).

Memo

Text, numbers, or any combination of the two, up to a maximum of 65,535 characters.

Number

Numbers to be used in mathematical calculations.

Date/Time

Dates and times. Dates must fall within the years 100-9999.

Currency

Numbers to be used in mathematical calculations, like a Number field. A Currency field doesnít necessarily involve money; itís just more efficient at calculating numbers with decimals. Use a Currency field for numbers with one to four decimal places.

AutoNumber

A unique number generated automatically when you create the record. AutoNumbers are either sequential and incremented by one or random. You canít change an AutoNumber once Access generates it. Use an AutoNumber field to create a unique identifier for each record in your table.

Yes/No

One of a pair of values: Yes/No, True/False, or On/Off. Data value may be represented by a check box.

OLE Object

An external object, such as an Office document, or a sound or graphic file, linked to or embedded in your table.

Hyperlink

Text, numbers, or any combination of the two, used as a hyperlink address. The entry is stored as text.

Lookup Wizard

This isnít a data type. Itís a tool you can use to create a lookup. In a lookup, Access gives you a list of values to choose from. Access gets these values by looking them up in another table or a list you create, then presenting them in a combo box or list box. Use a lookup to help you and others make valid entries in a field. Access sets the data type based on the values it looks up.

Notes

Plan carefully and set your fieldsí data types before you enter any data. Why? Because if you change the data type on a field that already contains data, Access will attempt to convert the data to the new type when you save the table. This could take a long time; more important, if your data is incompatible with the new data type, you may lose it.

You canít index a Memo, Hyperlink, or OLE Object field, so you canít use them as the common field in a join between tables.

The DataType, FieldSize, and Format properties work together. The FieldSize and Format properties are functions of the DataType. So:

(Posted 04/01/2004)