Introduction to Tables

Help Center > Microsoft Access > Introduction to Tables

Tables are organized into grids that you may find are similar to an Excel worksheet. There are three ways to create a table in Access. Double-click on one of the three icons in the Database Window to create a table. tableWindow

  • Create table in Design view allows you to define the fields of a table first.
  • Create table using wizard will guide you through the step by step creation of a table.
  • Create table by entering data will open a new blank datasheet with unlabeled fields that looks like an Excel worksheet. Enter data into the cells and click the Save button. You will be asked to set one of the fields as the primary key. After the table is saved, the unused cells are trimmed and fields are given generic names. To rename the fields, select Format|Rename Column from the menu bar or highlight the column by right-clicking on it and selecting Rename Column from the menu that appears.

Create a Table in Design View

Design View will allow you to define the fields in a table before adding any data. The window is divided into two parts: a top pane for entering the field name, data type, and an option description of the field, and a bottom pane for specifying field properties. designView

  • Field Name - should represent or summarize the contents of the field in a way that is easily recognizable. It can be no longer than 64 characters in length, including spaces.
  • Data Type is the type of data that will be entered into the field.
    • Text - is the default type, it has a maximum of 255 characters per field.
    • Memo - a subset of the Text type that can store up to 64,000 characters.
    • Number - Any number can be stored, specific types of numbers can also be specified.
    • Date/Time - A date, time, or combination of both.
    • Currency - used when the field represents monetary values. It can be set to include the proper currency symbol and decimal or comma.
    • AutoNumber - When a new record is created, Access will automatically assign it a unique integer. You can specify the increment by which the numbers are assigned or whether a random number should be selected in the General Options tab. Since every record must include at least one field that unique and cannot be replicated, Autonumbers are an easy way to fulfill this requirement.
    • Yes/No - Use this data type for values that can only be one of two options such as True/False, Yes/No, or On/Off.
    • OLE Object - An OLE (Object Linking and Embedding) object is something that was created in another program. This can include images, sound files and Word or Excel files.
    • Hyperlink - A hyperlink allows you to create a link to an Internet or Intranet site, or another placein the database. The link should be entered using the following format: DisplayText#Address#SubAddress#ScreenTip. The Address is the only required part of the string. Examples:
      Website: Google#http://www.google.com#
      Within a database: New Table#c:\My Documents\database1.mdb#newTable
  • Description (optional) - a brief description of the contents of the field. This is particularly useful if more than one person is using and editing the database.
  • Field Properties - Choose properties for the selected field from the bottom pane.

Primary Key

Every record in a table is required to have a primary key in order to identify it from other records in the database. You can set an existing field as the primary key if you are sure that every record will have a different value for that specific field. A social security number or student id number is an example of a value that will appear only once in a database table.
To designate the primary key field, right-click on the record and select Primary Key from the menu or go to Edit|Primary Key on the menu bar. The primary key field is indicated with a key icon the left side of the record. If none of the existing fields in the table will contain a unique value for every record, you must create a separate field. Access will ask you to create this field the first time you save the table if a primary key has not been assigned. You should set the data type to "autonumber" so that you do not have to create the primary key by hand.

Adding Records

The asterisk (*) indicates a new blank record. Begin entering data in the record marked with the asterisk to create a new one. You can also click the New Rocrd Button at the bottom of the datasheet window to jump to the empty record.

Editing Records

To edit records, place your cursor in the record you want to edit and make the necessary changes. The arrow keys on your keyboard can be used to move through the record grid.

Deleting Records

To delete a record, place your cursor in any field and select Edit|Delete Record from the menu bar or click the Delete Record button on the datasheet toolbar.

last modified on 06/27/2007 17:02