Microsoft Office Tutorials and References
In Depth Information
Referential Integrity
Figure 2-40
Edit Relationships dialog box
primar y table
related table
Enforce Referential
Integrity op tion
common field
type of relationship
cascade options
The primary table, related table, common field, and relationship type (One-To-
Many) appear in the dialog box. After you click the Enforce Referential Integrity
check box, the two cascade options become available. If you select the Cascade
Update Related Fields option, Access will update the appropriate foreign key
values in the related table when you change a primary key value in the primary
table. You will not select the Cascade Delete Related Records option because
doing so could cause you to delete records that you do not want to delete; this
option is rarely selected.
8. Click the Enforce Referential Integrity check box, and then click the Cascade
Update Related Fields check box.
9. Click the Create button to define the one-to-many relationship between the
two tables and to close the dialog box. The completed relationship appears in
the Relationships window, with the join line connecting the common field of
CustomerID in each table. See Figure 2-41.
Figure 2-41
Defi ned relationship in the Relationships window
“one” side of
the rel ationship
represented by
the digit 1
“many” side of
the rela tionship
represented by
the infinity symbol
join line
Now you need to defi ne the one-to-many relationship between the Contract and
Invoice tables. In this relationship, Contract is the primary (“one”) table because there
is at most one contract for each invoice. Invoice is the related (“many”) table because
there are zero, one, or many invoices set up for each contract, depending on how many
project phases are involved for each contract.
Search JabSto ::

Custom Search