About data types and field sizes (MDB)

Microsoft Office Access 2003

  • What kind of values do you want to allow in the field? For example, you can't store text in a field with a Number data type.
  • How much storage space do you want to use for values in the field?
  • What types of operations do you want to perform on the values in the field? For example, Microsoft Access can sum values in Number or Currency fields, but not values in Text or OLE Object fields.
  • Do you want to sort or index a field? OLE Object fields can't be sorted or indexed.
  • Do you want to use a field to group records in queries or reports? OLE Object fields can't be used to group records.
  • How do you want to sort values in a field? In a Text field, numbers sort as strings of characters (1, 10, 100, 2, 20, 200, and so on), not as numeric values. Use a Number or Currency field to sort numbers as numeric values. Also, many date formats will not sort properly if entered in a Text field. Use a Date/Time field to ensure proper sorting for dates.
  • Will you need to store Microsoft Word or Microsoft Excel documents, pictures, sound, and other types of binary data created in other programs? OLE objects can be linked to or embedded in an OLE Object field in a Microsoft Access table. To display the OLE object, use a control in a form or report.

  • Show Choosing between a Text or Memo field

    Microsoft Access provides two field data types to store data with text or combinations of text and numbers: Text and Memo.

    Use a Text data type to store data such as names, addresses, and any numbers that do not require calculations, such as phone numbers, part numbers, or postal codes. A Text field can store up to 255 characters, but the default field size is 50 characters. The FieldSize property controls the maximum number of characters that can be entered in a Text field.

    Use the Memo data type if you need to store more than 255 characters. A Memo field can store up to 65,536 characters. If you want to store formatted text or long documents, you should create an OLE Object field instead of a Memo field.

    Both Text and Memo data types store only the characters entered in a field; space characters for unused positions in the field aren't stored.

    You can sort or group on a Text field or a Memo field, but Access only uses the first 255 characters when you sort or group on a Memo field.

    Show Choosing between a Number or Currency field

    Microsoft Access provides two field data types to store data containing numeric values: Number and Currency.

    Use a Number field to store numeric data to be used for mathematical calculations, except calculations that involve money or that require a high degree of accuracy. The kind and size of numeric values that can be stored in a Number field is controlled by setting the FieldSize property. For example, the Byte field size will only store whole numbers (no decimal values) from 0 to 255 and occupies 1 byte of disk space.

    Use a Currency field to prevent rounding off during calculations. A Currency field is accurate to 15 digits to the left of the decimal point and 4 digits to the right. A Currency field occupies 8 bytes of disk space.

    Number and Currency fields provide predefined display formats, or you can create a custom format.

    Show Choosing between an incremented or random AutoNumber field

    Microsoft Access provides the AutoNumber data type to create fields that automatically enter a unique number when a record is added. Once a number is generated for a record, it can't be deleted or changed. An AutoNumber field can generate three kinds of numbers: sequential numbers that increment by one, random numbers, and Replication ID (also referred to as GUIDs— globally unique identifiers) numbers. AutoNumbers that increment by one are the most common kind of AutoNumber and are a good choice for use as a table's primary key. Random AutoNumbers will generate a random number that is unique to each record within the table. Replication ID AutoNumbers are used in database replication to generate unique identifiers for synchronizing replicas.