To assign appropriate data types to the fields you create in a table, it is necessary for you to know what differentiates the different data types available for use with your table fields. When you create a field, you want to assign it a data type so that Access knows how to handle its contents. The following are the different data types you can choose:
Text?/b> Text and numbers up to 255 characters ( numbers that are not going to be used in calculations).
Memo?/b> Lengthy text.
Number?/b> Numbers used in mathematical calculations.
Date/Time?/b> Date and time values.
Currency?/b> Numbers formatted for currency.
AutoNumber?/b> Sequentially numbers each new record. Only one AutoNumber field can be placed in a table. This field type is typically used for the primary key field.
Yes/No?/b> Lets you set up fields with a true/false data type.
OLE (Object Linking and Embedding)?/b> A picture, spreadsheet, or other item from another software program.
Hyperlink?/b> A link to another file or a location on a Web page. This field type lets you jump from the current field to information in another file.
Lookup Wizard?/b> This field type chooses its values from another table.
In addition to a field type, each field has other formatting options you can set. They appear in the bottom half of the dialog box, in the Field Properties area. The formatting options change depending on the field type; there are too many to list here, but Table 5.1 shows some of the most important ones you'll encounter.
Table 5.1. Formatting Options for Data Types
| Formatting Option || Description |
| Field Size || The maximum number of characters a user can input in that field (applies only to text fields). |
| Format || A drop-down list of the available formats for that field type. You can also create custom formats. |
| Decimal Places || For number fields, you can set the default number of decimal places that a number shows. |
| Default Value || If a field is usually going to contain a certain value (for example, a certain ZIP code for almost everyone), you can set that as the Default Value option. It always appears in a new record, but you can type over it in the rare instances when it doesn't apply. |
| Required || Choose Yes if a particular field is required to be filled in each record. |
The best general rule for setting the data type for the field is to take a moment to consider what kind of data will go into that field. For example, if you are working with the monetary value of a product, you will probably want to use currency.
The different formatting options provided for a field in the Field Properties box are often used to help make sure that data is entered correctly. For example, the Field Size option can be used to limit a Number data type field to only a single or double digit. In the case of the default value, you can actually save data entry time because you use this option when a particular field almost always has a certain value or text entry.