Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 1 ~
Information Systems Course 240
Online Tutorial
(Microsoft Access 2007)
The “Birds” Database Mini Project
Prepared By:
Eng. Asma Al‐Fadhel
Fall 2009/2010
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 2 ~
Topics to be covered
Topic Page
Introduction ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
3
Building the database ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 3
Creating a blank database ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 3
Creating the tables ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 3
Creating the relationship ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 3
Populating the tables ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 4
Creating Queries ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 4
Creating Reports ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 6
Creating Forms ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 7
Final Result ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ 8
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 3 ~
I] Introduction: For this tutorial we will create a database called “Birds” for a company specialized in selling products for birds and nature enthusiasts. The database consists of two tables representing the following relationship: This ER‐diagram (one‐to‐many relationship) is converted into two tables: Table (Supplier) having a primary key (Supplier_Code) Table (Item) having a primary key (Item_Code) with a foreign key (Supplier_code) P.S. We use the primary key from the (one side) as a foreign key in the (Many side).
II] Building the database:
Now follow the following instructions to build the database:
1. Open the MS Access 2007 and create a blank database, call it Birds. (See Video #1) 2. Create the following Tables: Save them under the names (Supplier & Item)
You MUST create the Supplier table first because you will use its primary key as a foreigner key in the Item table. (Create Table Design) (See Video #2)
3. Create the relationship between the two tables: (Database Tools Relationships) (See Video #3)
SupplySupplier Item 1 M
Medium format: (10‐jun‐07)
Link the primary key from the Supplier table with the foreign key
from the item table
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 4 ~
4. Now we can populate the tables with data from scratch (See Video #4) OR download the already made database with (tables, relationship and data). You MUST populate the Supplier table first to identify the Supplier_Code before using it in the Item table.
5. Now we have the tables filled with data, we are going to create some Queries: (Create Query Design) (See Video #5)
a. Create a query that displays the item code, description and supplier code fields
for items supplied by Supplier 21. Save it under the name (Supplier 21)
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 5 ~
b. Create a query that displays the item code and description fields for all items having the description starting with the letter “b”. Save it under the name (Letter B)
c. Create a query that displays all fields for those items with a selling price greater than $30. Save it under the name (Price >30)
d. Create a query that displays the item code, description, selling price and cost fields along with a new field called profit that is equal to: (selling price ‐ cost) for all items. Save it under the name (Profit)
The new fields name
Existing fields names (should be written
exactly the same and in square brackets)
Minus sign ( ‐ )
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 6 ~
e. Create a query that displays the average cost of items grouped by supplier code. Save it under the name (Average cost)
6. Now we are going to create two Reports: (Create Report Wizard) (See Video #6)
a. Create a report that displays the item code, description, selling price, cost and profit fields for all items. Save it under the name (Profit)
A new raw appears
Group by Supplier code
Average for the cost
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 7 ~
b. Create a report that displays for each supplier the Supplier code, name, and all the items that he supplies. Save it under the name (Supplier and items)
7. Now we will create two Forms (a simple form & a master form) using the wizard. (Create More Forms Form Wizard) (See Video #7)
a. Create a form that displays the supplier information. Save it under the name (Supplier)
MS Access 2007 Online Tutorial for (QMIS240) Prepared By: Eng. Asma AL‐Fadhel
~ 8 ~
b. Create a master form that displays the item information for each supplier along with each supplier’s information. Save it under the name (Master Form)
P.S: you can re‐arrange the fields by switching to the design view (right click on the field layout remove) and you can also use the layout view.
III] Final Result:
Our final database should have the following objects: