Microsoft Office Tutorials and References
In Depth Information
Creating Relationships and Protecting Your Data with Referential Integrity
1. Click the Show Table button in the Relationships group on the
(Relationship Tools) Design tab of the Ribbon.
The Show Table dialog box appears.
2. Click the name of any table you want to add to the Relationships
window and then click the Add button.
3. Repeat Step 2 as many times as you want to add multiple tables to the
You can select multiple tables by holding down the Ctrl key as you
select table names.
4. Click the Close button in the Show Table dialog box.
The Show Table dialog box closes, and voilà — the tables you chose
are visible in the Relationships window. The window doesn’t display
the entire table, of course; that would be too big. Only a field list, which
shows the names of all the fields in the table, appears for each table you
select. You can move those field lists around by dragging their title bars
and size them by dragging any corner or edge.
Setting referential integrity between two tables
When you have two or more tables in the Relationships window, you can
define their relationships and referential integrity. Here’s how:
1. Click the matching key in either table to select that field name.
If you’re joining the Address Book and Orders tables shown in Figure 6-3,
earlier in this chapter, you click the ContactID field in either table.
2. Drag the selected field name to the corresponding field name in the
other table, and drop it there.
The Edit Relationships dialog box opens (see Figure 6-4).
3. If you want to turn on referential integrity, select the Enforce
Referential Integrity check box.
The Cascade options (below the Enforce Referential Integrity check box)