Reviewing Table Relationships

When we first discussed creating a database in the Access section of this book, we made a case for creating tables that held discrete subsets of the data that would make up the database. We then discussed the importance of creating relationships between these tables in Lesson 9, "Creating Relationships Between Tables." In this lesson, you take a look at how you can take advantage of related tables when creating other Access objects, such as forms, queries, and reports .

As previously discussed in Lessons 1 and 9, tables are related by a field that is common to each table. The common field serves as the primary key in one of the tables and as the foreign key in the other table. (The foreign key is the same field, but it is held in a table where it does not serve as the primary key.)

For example, in Figure 19.1, an Employees table is linked to two other tables: Expenses and Departments. The Employees table and the Expenses table are related because of the EmployeeID field. The Employees table and the Departments table are related by the DepartmentID field.

Figure 19.1. Related tables share a common field.

graphics/91fig01.jpg

The more complex your database, the more tables and table relationships the database contains. For example, Figure 19.2 shows a complex company database that contains several related tables.

Figure 19.2. Complex databases contain many related tables.

graphics/91fig02.jpg

More important to the discussion in this lesson is how you take advantage of related tables to create complex forms and reports. First, take a look at how related table data can be viewed in the Table Datasheet view.



Microsoft Office 2003 All-in-One
Microsoft Office 2003 All-in-One
ISBN: B005HKSHB2
EAN: N/A
Year: 2002
Pages: 660
Authors: Joe Habraken

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net