Introduction to Microsoft Access and Databases 2/8

Creating tables
Setting a primary key

Indexing fields
Defining Table Relationships
Creating a custom form

Creating a hyperlink field

* Creating tables

1.    In the new Database window, click on Tables in the Object bar.

2.    Double click the Create Table In Design View icon.

3.    Type a field name for the first column you want to create in the Field Name column.


4.    Click in the Data Type field for the same row, and click on the Data Type drop-down arrow that appears, then click on the data type you want to assign to the field just created.

5.    Fill in the Description field for the same row, and type a description of the field’s properties and purpose.

6.    Press enter to go to the next row.

7.    Repeat steps 3 through 6 as necessary to add new fields to the table.

8.    Close the Table window.

9.    Click yes to save the table, enter a table name, then click on ok.

* Setting a primary key

1.    In Design View, create a field that will be that table’s primary key, and select an appropriate data type.
If you choose the AutoNumber data type, Access assigns a value to the primary key for a new record that is one more than the primary key in the previous record.

If you choose any other data type, such as text, number or Date/Time, during data entry, you must enter a unique value in the appropriate format for the primary key of each new record.

2.    Click the row selector (the blank, gray field heading the row you wish to select) of that field.

3.    Click the Primary Key button on the Table Design toolbar. It is the key shaped icon, shown grayed out below (immediately next to the lightning shaped Indexes icon).

* Indexing fields

1.    Display the table in Design view

2.    Click the Indexes button on the Table Design toolbar.

3.    Type a name for the index.

4.    Select a field to act as an index.

5.    Indicate whether the field should be indexed in ascending or descending order.

6.    Click the Close button.

* Defining Table Relationships

1.    In the Database window, lick the Relationships button on the Database toolbar.

If relationships are already established in your database, they appear in the Relationships window.

2.    If necessary, click the Show Table button on the Relationship toolbar to display the Show Table dialog box.

3.    Click the Tables tab

4.    Click the table you want

5.    Click Add. The table or query selected appears in the Relationships window.

6.    Repeat steps 4 and 5 for every table you want in the relationship.

7.    Click Close

8.    Click the common field in the first table and then drag itto the common field in the second table. When you release the mouse button, a line appears between the two tables, signifying that they are related.

* Creating a custom form :

1.    In the Database window, click Forms on the Objects bar, and then click the New button.

2.    Click Design View, select the table or query from which the data will come, and then click OK.

3.    If the Forms toolbar isn’t already visible, activate it by clicking on the Toolbox icon on the Form Design toolbar at the top of the screen.

4.    Select the field you want to add to the form.

5.    Drag the field to the location in the form where you want the field to appear, and then release the mouse button to position the field.

6.    Create new controls as needed by clicking the appropriate toolbox button.

7.    Format the text in the form, as needed.

8.    Click the Save button on the Form Design toolbar to name the form and save it in the database.

* Creating a hyperlink field

  1. Display the table in Design view.
  2. Create a new field in which you want to store a hyperlink.
  3. Click the Data Type dropdown arrow, and then click Hyperlink.
  4. Click the save button on the Table Design toolbar to save the changes to the table.