• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Creating Relationships Betwee... > Creating a Relationship Between Tabl...

Creating a Relationship Between Tables

To create a relationship between tables, open the Relationships window. Before you can create relationships between tables, you must first add the tables to the Relationships window. Follow these steps:

  1. In the database, select Tools, Relationships, or click the Relationships button on the toolbar to open the Relationships window.

  2. If you haven't selected any tables yet, the Show Table dialog box appears automatically (see Figure 9.1). If it doesn't appear, choose Relationships, Show Table.

    Figure 9.1. Add tables to your Relationships window with the Show Table dialog box.

  3. Click a table that you want to include in the Relationships window, and then click the Add button.

    Tip

    Well-Designed Databases and Relationships In a well-designed database, every table in the database is related to at least one other table in the database. So, you might want to add all your tables to the Relationships window.


  4. Repeat step 3 to select all the tables you require in the Relationships window, and then click Close. Each table appears in its own box in the Relationships window, as shown in Figure 9.2. Each table box lists all the fields in that table.

    Tip

    Enlarge the Table Box If you can't see all the fields in a table's box, drag the table border to make it large enough to see all the fields.


  5. After you have the tables available in the relationships window, you can create the relationships between the table. Remember that you must link the tables using a common field. For example, you can link the Customers table to the Orders table using the Customer ID field, as shown in Figure 9.2. Select the common field in the table where it is the primary key (in this case, the Customer table). Drag the field and drop it on its counterpart (the same field name) in the other table (in this case, Orders). The Edit Relationships window opens (see Figure 9.3).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint