Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE...
-
Upload
olivia-fleming -
Category
Documents
-
view
232 -
download
0
Transcript of Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE...
![Page 1: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/1.jpg)
Working with Multiple Tables in Microsoft Access
The Access Workbench: Section Two
DAVID M. KROENKE and DAVID J. AUER
DATABASE CONCEPTS, 3rd Edition
![Page 2: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/2.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-2
Section Objectives
Learn how to use Microsoft Access to: Illustrate modification problems Create relationships between tables Create multiple-table forms Create multiple-table reports
![Page 3: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/3.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-3
Illustrating Modification Problems
• When a table contains data from multiple themes, it is subject to modification problems
• This topic was discussed in detail in Chapter 1
• We will use an Access database to illustrate a modification problem
• The data is in a provided database named WMCRM-Combined-Data.mdb
![Page 4: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/4.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-4
CONTACT Data
CustomerID Date Type Remarks
1 7/7/2005 Phone General interest in a Gaea.
1 7/7/2005 Email Sent general information.
1 7/12/2005 Phone Set up an appointment.
1 7/14/2005 Meeting Bought a HiStandard.
3 7/19/2005 Phone Interested in a SUHi, set up an appointment.
1 7/21/2005 Email Sent a standard follow-up message.
4 7/27/2005 Phone Interested in a HiStandard, set up an appointment.
3 7/27/2005 Meeting Bought a SUHi.
4 8/2/2005 Meeting Talked up to a HiLuxury. Customer bought one.
3 8/3/2005 Email Sent a standard follow-up message.
4 8/10/2005 Email Sent a standard follow-up message.
5 8/15/2005 Phone General interest in a Gaea.
![Page 5: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/5.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-5
Security Warning
• Each time you open an existing database, the Security Warning dialog box will be displayed–as long as you are familiar with the database file, Click the Open button
![Page 6: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/6.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-6
Illustrating Modification Problems:
The CUSTOMER_CONTACT Table
![Page 7: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/7.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-7
Illustrating Modification Problems:The Customer-Contact Data Input Form
All fields from the CUSTOMER_CONTACT table appear on the form
Form browsing buttons
![Page 8: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/8.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-8
Illustrating Modification Problems:The Wallingford Motors Customer Contact Report
All contact data for each customer is grouped together and sorted by date
![Page 9: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/9.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-9
Illustrating Modification Problems:
Form with the Updated Email Address
The Email address has been updated
Next record button
![Page 10: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/10.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-10
Illustrating Modification Problems:Updated Wallingford Motors Customer Contact Report
A modification problem has occurred. Not all records were updated with the new email address, and the database records are now inconsistent.
![Page 11: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/11.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-11
Working with Multiple Tables:WMCRM Database Schema
CUSTOMER (CustomerID, LastName, FirstName, Address, City, State, ZIP,Phone, Fax, Email)
CONTACT (ContactID, CustomerID, Data, Type, Remarks)
CustomerID in CONTACT must exist in CustomerID in CUSTOMER
![Page 12: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/12.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-12
Working with Multiple Tables: CONTACT Table Column Characteristics
Column Name Type Key Required Remarks
ContactID AutoNumber Primary Key Yes Surrogate Key
CustomerID Number Foreign Key Yes Long Integer
Date Date/Time No Yes Short Date
Type Text (10) No Yes Allowed values are Phone, Fax, Email and Meeting
Remarks Memo No No
CONTACT
![Page 13: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/13.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-13
Working with Multiple Tables:Setting the Date Format
Select the Short Date date format from the drop-down list
![Page 14: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/14.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-14
Working with Multiple Tables:
Opening the Relationships Window
Click Tools, then click Relationships…
![Page 15: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/15.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-15
Working with Multiple Tables:Adding Tables to the Relationships Window
Select a table name, then click the Add button to add the table to the Relationships window
![Page 16: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/16.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-16
Working with Multiple Tables:Creating a Relationship
• To create a relationship between two tables:– In the Relationships window, drag a
primary key column and drop it on top of the corresponding foreign key column
![Page 17: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/17.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-17
Working with Multiple Tables:The Table Objects in the Relationships Window
The table objects have been enlarged and rearranged into the arrangement shown here
Click, drag and drop the CUSTOMER CustomerID field onto the CONTACT CustomerID field
![Page 18: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/18.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-18
Working with Multiple Tables:The Edit Relationships Dialog Box
Click the Enforce Referential Integrity check box, and then click the Create button to create the relationship
![Page 19: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/19.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-19
Working with Multiple Tables:The Completed Relationship
The new relationship now appears in the Relationships window diagram—note that the line connects the related fields
![Page 20: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/20.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-20
Working with Multiple Tables:Data in the CONTACT Table
![Page 21: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/21.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-21
Working with Multiple Tables:The Completed Form for CUSTOMER and CONTACT Data
Buttons for scrolling through the CONTACT records for this customer
Buttons for scrolling through the CUSTOMER records
![Page 22: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/22.jpg)
KROENKE and AUER - DATABASE CONCEPTS (3rd Edition)© 2008 Pearson Prentice Hall AW-2-22
Working with Multiple Tables:The Wallingford Motors Customer Contacts Report
Data for each customer
List of contact data for each customer
![Page 23: Working with Multiple Tables in Microsoft Access The Access Workbench: Section Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.](https://reader036.fdocuments.in/reader036/viewer/2022081506/56649ebc5503460f94bc4d03/html5/thumbnails/23.jpg)
Working with Multiple Tables in Microsoft Access
End of Presentation on The Access Workbench: Section Two
DAVID M. KROENKE and DAVID J. AUER
DATABASE CONCEPTS, 3rd Edition