Presentation on Microsoft Access Database creation and management

chhayaparihar1308 32 views 96 slides Jul 17, 2024
Slide 1
Slide 1 of 96
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96

About This Presentation

The document introduces Microsoft Access and describes its key objects - tables, queries, forms and reports. It explains how to create and manage each object type, entering data, sorting records, and switching between views. Formatting, fields, data types, primary keys, and printing are also covered...


Slide Content

Microsoft Access
Database Creation and Management

Overview of Access Database
One of database management systems
software.
Access, SQL Server, Oracle, DB 2
MS Access is a relational database.
a collection of tables that are related to one
another based on a common field.

Relational Database
A schematic diagram of a relational database (a) and a sample part of a
relational database showing different tables (b)

Open an existing database
Create a folder by your last namein My
documents oronDesktop
Download“Restaurant1”database intothe folder
by your last name then, open the “Restaurant1”
database
To open an existing database, you must first start
Access
When Access is launched you will see the Access window,
with the task pane on the right side of the window.
From the task pane, you can open an existing database.
Or simply double-click the existing database to open.

How Access creates and saves a new
database
Create a new database
Your first activity (before question #1) for the midterm
is creating a new database.
Database name: your last name + first initial of first name
When you press the Save button in Access, you are
saving the design of the Access objects and NOT the
database itself!
The Save function in Access differs from the Save function in
other Windows programs.

Characteristics of Relational DB
In a relational database, each record (row)
in a table must be uniquely identified.
Using Primary Key
A relational database is a collection of
tables that are related to one another
based on a common field.
Using Foreign Key (& Primary Key)

Primary Key (PK) & Foreign Key (FK)
PK: A field thatuniquely identifies each recordin a
table.
SS#, StudentID
It does not have to be first field.
FK: A field that connects one table logically with
another table
Rule of Thumb:PK = FK (value) –see next slide

Relating tables using PK and FK
The primary key in the
Employer table (EmployerID)
is the common field that
relates this table to the
Position table.
PositionID is the primary key in
the Position table. The
EmployerID field is a foreign key
in this table.
Primary keys can only have one
occurrence in a table. Foreign keys
may have multiple occurrences.

Valle Coffee’s Restaurant DB
Valle is a small distributor of inexpensive coffee beans
to various restaurants. Barbara Hennessey, the Director
of CRM, and her staff use Access to maintain company
data such as customer orders and billing, coffee supplier
orders and payments, and advertising placements and
payments. Barbara has a recently developed database
named Restaurant 1to track the company’s
restaurant customers, their orders, and related data
such as the products they order. She asks for your help
in completing and maintaining this database.

Descriptions of Restaurant DB
Valle coffee’s Restaurant 1 database will
contain five tables:
Customer table, which Barbara already has.
Order table, which you will create soon.
Product and Order Detail tables, which you
will import from FineFood database.
Billing Address tablethat is in Excel format
and you will import it, and then convert to Access
table.

Creating a Order table
Barbara wants to track information about each order
placed by each restaurant customer. This information
includes the order’s billing date and invoice amount.
Barbara asks you to create a second table in the
Restaurant database, named Order, in which to store
the order data.

Creating a Order table
Use Design view
Case sensitive
NUMBER vs. number
Exact match of each name
Use tap key to enter data
Especially, when you enter data in datasheet view.

Access data (field) type
Make certain the field type you select matches the data to be held in that field.

Access data (field) type (con’t)
Additional Access field types.

Creating the Order table
Field Name Data Type Description Field Properties
OrderNum Text primary key Field size (3), Required (Yes)
CustomerNum Text foreign key Field size (3)
BillingDate Date/Time
PlacedBy Text person who
placed order
Field size (25)
InvoiceAmt Currency

Adding Records to a Table
Enter data sequentially in Datasheet view
Do not jump from field to field
Use tap key to enter data
OrderNum CustomerNum BillingDatePlacedBy InvoiceAmt
323 624 02/15/2001Mike Smith $1,986.00
201 107 01/15/2001Matt Davis $854.00

Modifying a Table
From the Ordertable
Delete the PlacedByfield
Move the BillingDatefield to the end of the table
Insert the Paidas a new field between CustomerNumand
InvoiceAmt (position) fields
data type: Yes/No
default value: No (means “unpaid”)
Add following data to each filed: 211, 201, paid (mark the
check box using space bar), $703.50, 01/15/2001

Practice: Creating a DB
Barbara needs a database to track the coffee
products offered by Valle Coffee. She asks you to
create the database by completing the following:
In the initial Microsoft Access dialog box, click the
blank Access database option button, and then click
OK button. Click the Create button the new
database.
YOUR LAST NAME DB file name
Display the Table window in Design view (if
necessary), and then create a table using the table
design shown in the next slide.

Practice: Creating a Table
Specify ProductCode as the primary key, and then save the table as
Product.
Add the product records shown in next slide table to the Producttable.
(Hint: You must type the decimal point when entering the Price field
values.)
Field NameData TypeDescription Field Properties
ProductCodeText Primary Key Field size (4), Required: Yes
CoffeeCode Text Foreign Key Field size (4)
Price CurrencyPrice for this product
Decaf Text D if decaf, Null if
regular
Field size (1), Default Value: D
BackOrderedYes/No back-ordered from
supplier?
Default Value: No

Practice: Modifyinga Table
Add a new field between the CoffeeCode and Price fields, using these
properties;
Field Name:WeightCode
Data Type: Text
Description: foreign key
Field Size:1
Move the Decaf field so that it appears between the WeightCode and
Price fields.
ProductCode CoffeeCode Price Decaf BackOrdered
2316 JRUM 8.99 Yes
9754 HAZL 40.00 D Yes
9309 COCO 9.99 D No

Practice: UpdatingaTable
Enter these WeightCode values for the three records: A for
ProductCode 2316, A for ProductCode 9309, and E for
ProductCode 9754.
Add a record to the Product datasheet with these field values:
ProductCode: 9729
CoffeeCode: COLS
WeightCode: E
Decaf: D
Price: 39.75
BackOrdered: Yes

Data Integrity (PK Rule)
No “null” value can be allowed.
No two records can have the same primarykey.
No two CSUB students can have same ID number.
A PKcan be “composite key”
Example on class web page
“Composite PK Example”
More than one field can be used as a PK (composite)
CSUB: student ID + SS#

Referential Integrity (FK Rule)
A field that connects one table logically with another
table.
Exception exampleon class web page
“PK as FK” there are two tables…
Related table: Shipping Address table
Primary table: customer table

Importing External Access Table and
Excel Worksheet
Barbara also wants you to include the Productand
Order Detailtables from the FineFood database in
the Restaurant database.
Download and Review designview of FineFood
DBfirst

Importing External Access Table and
Excel Worksheet (con’t)
And she wants you to include the Billing Address
Excel worksheet as a Access table in the Restaurant
database.
Before try to import the excel file, review it first
Use Excel column headings for Access table
PK:CustomerNum
Specify in the description area of Design View that
CutomerNum is not only primary key of
BillingAddress table but also a foreign key of
Customer table.

Access is a relational database
Access allows you to form relationships between the
tables; that’s why it’s called a relational database
The simplest way to create a relationship
Look for identical field namesbetween tables.
Tables can be joined in three ways; one-to-one, one-
to-many, and many-to-many.

An example of a
one-to-many relationship
The Employer table is related to the Position table via the common field EmployerID.
The Employer table has
one record for EmployerID
value 10126. The Position
table has two records.

A one-to-one relationship
A one-to-one relationship exists when one
table has one record associated with only
one record of another table.
As we saw from PK as FK database
Shipping Address table is an related table.
Primary table: customer table
Primary key is also foreign key: only Access

Using referential integrity
Referential integrity allows you to maintain the
integrity and consistency between related tables.
If you choose to enforce referential integrity, you can insure
that you will not have records that have no matching record
in the primary table.
The rules associated with referential integrity specify
that when you update or delete a record (PK) in the
primary table, a matching record (FK) in the related
record must be updated or deleted.

Use cascade update
and cascade delete
In referential integrity, there are two options.
If you choose cascaded updates, making a change in a field
that is common to two related tables will cause the update
to be made in both tables.
If you delete a field that is common to two tables, the
deletion will take place in both tables.
Enforcing Access Referential integrity Rules
TryReferential Integrity ExampleDB on the class
web page.

Creating Relationships
DownloadRestaurant2file from the class web
Create relationships using 5 table
In terms of creating a relationship between Customerand
BillingAddress, start from the Customer table.
Enforce both cascade options
Primary key of the OrderDetail table
Combination of OrderNum and ProductCode
Otherwise, a duplication of the quantity field in both the
Order and Product tables.

Practice: Creating Relationship1
Create a blank database(use any name you like)And
then, import the three Excel Worksheets (Course,
Instructor, and Membership) from the class web site
into your Access database.
Define each imported table’s primary key using
information below:
Course table: Class_Number
Instructor table: Employee_Number
Membership table: Member_Number

Practice: Creating Relationships2
Establish relationship based on common fields.
And enforce referential integrity (apply both options)
among three imported tables

What is an Access query?
You can create a querywhen you need ONLYa portion of the
dataform tables (or existing queries).
For example, you may only need to see customers who live in CA.
The response would be to display only the records whose state
field matches with CA.
Multiple tables or queries can be used.
Restrictions can be used
Comparison operators
The design view is usedto specify the fields and records you
want to see.

The Query Design view window
Fields used in the query are selected from
the field list and added to the design grid.
You can run the query at any
time by clicking the Run button.

Creating a Sample Query
Kim Carpenter, the director of marketing at the Valle,
wants a list of all restaurant customers so that her
staff can call customers to check on their satisfaction
with Valle coffee’s services and products. She wants
to have only followings; CustomerName, City,
State, OwnerName, andPhone.
Use restaurant 3 database
Save the query as First Customer List.

OrderNum CustomerNum PaidInvoiceAmt BillingDate
201 107 No 854.00 01/15/2001
OrderNum ProductCode Qty
201 2834 11
ProductCode CoffeeName Weight/Size Price Decaf
2301 Colombian Aged Crop 1 lb pkg 7.99
Billing Address Table
Customer Table
Order Table
Order Detail Table
Product Table
CustomerNum CustomerName Street City StateZipCode OwnerName Phone FirstContact
000 Choi COB 105 CSUB CA 93311 Scott Choi 5348 09/20/2001
CustomerNum BillingName Street City StateZip
129 Sandy Lookout
Restaurant
PO Box 2800 GrandvilleMI 49468

More about a Query
When you use the query design window, you use
Query By Example(QBE).
Do not include any unnecessary tables or queries in
Design View of the query.
Otherwise, you have to deal with unexpected problems.
In your midterm, you will be penalized if you include
unnecessary tables or queries.
Always use a primary table.
CustomerNum: Customer vs. BillingAddress
Restrictions can be used as well.

Creating Queries using
Multiple Tables
Since there have been some major changes in the
Restaurantdatabase, Barbara wants to make sure
that the database is reliable. In order to test the
reliability of database query function, She wants
you to generate a query. The query must include
following fields: Order Number, Coffee Name,
Quantity, Price, and Weight/Size.
Save as Test
Should select OrderNum from the Order table
(primary table)

Querying and Sorting of
multiple Tables
Barbara wants to have following information for the
upcoming quarterly report: CustomerName, City,
State, BillingDate, InvoiceAmt, Paid, and First
Contact.
At same time, Barbara wants to sort the records by
the InvoiceAmtfield in ascending order.
Barbara also wants to move thePaid field between
the Stateand BillingDatefield.
Save as Customer Orders

Words beginor end with a:LIKE a*or LIKE *a
Find between values: (NOT) BETWEEN 45000 AND 78000
Find exact match value:1/10/2005
Expressions

Findan Exact Match
Barbara would like to have a list of all orders billed
on 01/15/2001.
The list must include following fields; OrderNum,
Paid, InvoiceAmt, BillingDate, CustomerName,
State, OwnerName, and Phone
Save as Jan Orders

Using Like a*
Barbara wants to know a list of all Customer Names
that begins with M. The list must include following
fields; Customer Name, Order Number, First
Contact and Billing Date. In addition, the Order
Numbermust be sorted in ascendingorder.
Save as Customer Name Begins With M

Using Between ** and **
Barbara wants to know a list of all Product Code
between 2465 and 2763. The list must include
following fields; Product Code, Coffee Name and
Price.
There should a space between number and word
Save as Product Code Between 2465 And 2763.

Using Greater than (>)
Barbara wants to know those records whose
InvoiceAmt exceeds$2,000.
Use the Customer Orders query.
The query must include only following fields;
Customer Name, Invoice Amount, and Billing
Date.
Save as High Invoice Amounts

UsingAndand OrOperators
The And
condition.
The Or
condition.

Creating And and Or conditions
in the design grid
And conditions must be
specified on the same line.
Or conditions must be specified on different lines.

Using AND
Leonard asks Barbara for a list of orders billed on
01/15/2001 that are still unpaid. He wants to know
which customers are slow in paying their invoices.
Use the Customer Orders queryagain and make
sure that this query includes following fields;
CustomerName, Paid, BillingDate, and
InvoiceAmt.
01/15/2001 ANDunpaid (No)
Save as Unpaid Jan Orders

Using OR
Leonard wants to determine which restaurant
customers are most valuable to Valle Coffee.
Specifically, he wants to see a list of those customers
who have been placing orders for many years
(specifically, first contact date -earlier than
01/01/1994: <=01/01/1994 ) ORwho place orders
for a substantial amount of money (greater than
$2,000: >2000), so that he can call the customers
personally and thank them for their business.

Using OR
Make sure that this query includes following fields;
CustomerName, InvoiceAmt, and First Contact.
He also wants to have a sorted outputin
ascendingorder based on the customer name.
If you want, you can use the Customer Orders
queryagain
Save as Top Customers

A calculated field in
the query datasheet
Expression Builder adds your calculated field to the query design grid. You can then
assign it a name, which will display in query datasheet view when the query is run.

Use of “Build” Function

Performing Calculation
Leonard is considering adding a 2% late charge to
the unpaid invoices. He only wants to include
following fields; Customer Name, Paid, Billing
Date, and Invoice Amount.
Set unpaid field to “No”

Performing Calculation
And he wants to know exactly what these charges
would be. He wants to create a new field “Late
Charge” right after InvoiceAmt field and then use it
to calculate late charge.
Late charge formula: InvoiceAmt*0.02
Save as Unpaid With Late Charge

Using Aggregate Functions
Barbara prepares a report of Valle coffee’s restaurant
business for Leonard on a regular basis. The
information in the report should include a summary
of the restaurant invoice statistics: the total invoice
amountfor all orders, the average invoice
amount, and the number of orders(same as
number of invoice amount). She asks you to
create these statistics.

Using Aggregate Functions
Access has several Aggregate
Functions that can be used to
calculate various statistical
information.
Aggregate functions are specified in the
Total row of the design grid. They can
be assigned by clicking the Totals
button on the Query Design toolbar.

Using Aggregate Functions
She also wants you assign a new field as follows;
Total of Invoices (total invoice amount for all
orders)
Average of Invoices (average invoice amount)
Number of Orders(number of invoice amount)
Save as Invoice Statistics

Using Record Group Calculations
Barbara’s another report to Leonard also includes the
same invoice statistics (total, average, and count).
Because Valle Coffee sends invoices to its
customers eachmonth(Jan invoice, Feb Invoice,
and March invoice), each invoice has the same
billing date. Barbara asks you to display the
invoice statistics for each month(billing date).
Grouping by each month

Using Record Group Calculations
Calculate statistics for groups of records
Average salary by the position
Number of employees in each department
Group By operator
Divides the selected records into groups based on the values
in the specified field
Those records with the same value for the field are grouped
together.
Save as By Billing Date

Query Practice 1
Download a database: “Roadrunner”
I would like to have a query that includes following
fields; Employee Number, Instructor LastName,
Instructor FirstName, Course Nameand Time.
SaveasYour Course Info.
I would like to have a query that ONLY includes the
male members who live in Burbankusing following
fields; First Name, Last Name, Gender, City, and
State.
Save as Males in Burbank.

Query Practice 2
I would like to know a list of all members whoselast
name begins with P using following fields; First
Name, Last Name, City, and State.
Save as Last Names begin with P.

Query Practice 3
I would like to know ONLY theEmployee Number,
Instructor Last name, Instructor First name, and the
Salary Amount for only those employees who make
between $39,500 and $55,000.In addition, the
resulting salaries must also be placed inorder from
high salary to low salaries.
Save as Between Salaries.

Query Practice 4
I would like to know the Class Number, Last Name,
and Member Numberfor each member who has a
class number greater than or equal to 8900. In
addition, sort last names inascending order.
Save as Greater than or equal to 8900.

Query Practice 5
I would like to know a list of all members whoselast
name that begins withAor a first name that begins
with Rincluding the following fields: First Name, Last
Name, City, and State.
Save as Names with A or R.

Query Practice 6
I would like to know an instructor who teaches
handball and students who are taking handball
course. Following fields must be appear on the
query: Instructor FirstName, Instructor LastName,
Course Name, Member Last Name and Member First
Name.In addition, the member last names should be
sorted in alphabetical order.
Save as Handball Listing

Query Practice 7
I would like to know a whole list of the Instructor
Last name, Instructor First name, and the Salary
Amount.Since instructors have worked hard, I would
like to increase their salary by 15%.So, I’d like to
calculate 15% salary increase for each instructor.
Save as Salaries Increase

Query Practice 8
I would like to know the Sum, Average, Max. and
Min. of employees salary(These four items must all
appear in the same query).
Save as Salary Calculations
I would like to know the Sum, Average, Max. and
Min. of employees salary based on Employee Type.
Save as Employee Type

Forms
Forms are used to customize your data entry screen.
Forms are created for the convenience of the user.
Forms are used to update Data Tables.
You can change locations of fields and colors very
easily in the Design screen.

Creating a Form
After Kim leaves for her staff meeting, Barbara asks you to
create a formfor the Customer table because the staff are not
allowed to access the database directly. Thestaff members
should be allowed only for entering data. But, using a form, the
staff can work data easily in the table.
Download “Restaurant 3” database again.
Open Customer table to identify # of records (38)
Create using “Form Wizard”
Layout: Columnar & Style: International
Save the form as Test Form

Adding a Record into the Form
Add following information as a Record No.39
customer;
CustomerNum: 000
CustomerName: Your Last Name
Street, City, State, and ZipCode: Your Address
OwnerName: Your Full Name
Phone: Your Phone Number
FirstContact: 09/20/2001
A record No. 39 added to the Customer table (it’s has
been altered).

Modifying a Form
Modify the Test form based on below requirements
using the Design View of Form
Make sure that City, State, and Zip Code are on the same
line
Title of field: Label box
Actual entry space: text box
In order to move both boxes together, place the cursor
between LABEL and TEXT boxes. Then, the shape of cursor will
be changed to a black colored hand.

Modifying a Form (con’t)
Put a space between wordsfor followings:
CustomerName, OwnerName, andFirstContact
Change CustomerNum to Customer No
Change Phoneto Phone Number
Add a label in the Form Header sectionin order to
create a title of this form. The title (use label button
from the Toolbox)for theform should be
CustomerData Entry Form.
The font size of the title should be a minimum of 20
and thetitle must be centered.

Forms Practice
Create a form for the Membership Tablefrom the
Roadrunner database. Begin your form with the
Wizard and then modify it so that:
Member Number is on the top line
Last Name and First Name is on the same line
Address is on a line by itself
City and State are on the same line
Class Number and Gender are on the same line
The labels for Member Number, Last Name, Address, City,
and Class Number should all be lined up vertically with the
same left border/margin

Forms Practice(con’t)
The labels for First Name, State, and Gender should
all line up vertically with the same left border/margin.
You must also space out your fields and rows so that
there is plenty of space around each field.
They should not be crowded together.
You should also add a label to your form in the Form
Header section. The label (use label button)for your
form should be Membership Data Entry Form.
The font size should be a minimum of 16 point
font.
Your title must also be centered.

Forms Practice (con’t)
You will need to change the font color of your
label text and the fill color for your label text
so that your form label is easily viewable on your
computer screen, given the style color/pattern that
you selected for your background.
Save as Membership Data Entry Form.

Reports
Reports are used to “Dress Up”or summarize
your data.
Reports can be made from a Table or Query.
You can use a Wizard to create your reports or
you can customize them to fit your needs.
You can specify sorting orders and you can also
group data.

Creating a Report
Kim returns from her staff meeting with another request.
She wantsto have a list of OrderNum, CustomerNum,
Paidand InvoiceAmt. from the Order table. She’d
like the information presented in a more readable format
for senior managers.
Create using “Report Wizard”
Layout: Tabular and others
Group by: CustomerNum
Sort the InvoiceAmt in descending order
Save the report as Order List

Modifying a Report
Insert CSUB logo upper-right cornerof the report
The title is Order List report.Title requirements;
The title must be centered. Change background and font
color. Change font size to 24.
Put a space between wordsfor followings:
OrderNum
CustomerNum
InvoiceAmt

Modifying a Report (con’t)
Change order Num toOrder No
Change Customer Num toCustomerNo
Change InvoiceAmtto Invoice Amount
Widen out the heading names and field entries so
that nothing is cut off. Space outyour data fields
as well.Also,adjust vertical alignment of
each field.All words in the report must be clearly
visible.

Report Practice
We will make a report that combines elements of the
Instructor Table with elements from the Course
Table.
From the Instructor Table, your report will include
Employee Number and Instructor Last Name.
From the CourseTable, your report will include
Class Number, Course Name, and Time.
You need to group by Employee Number. Class
Numbershould be sorted in ascending order.
The report is called Teaching Assignments.

Report Practice (con’t)
After you create the basic form of the report using
the Wizard, we will next need to go into the design
screen and customize the report. Center the title
in the middle of the page.
Change Employee_Number to Employee No.
Change Instructor_Last to Instructor.
Change Class_Number to Class.
Change Course_name to Course
Widen out the heading names and field entries so
that nothing is cut off. Space outyour data
fields.All words in the report must be clearly
visible.

Preview your report before
printing it
Use the Print Preview
option to see if the report
is as you want it to be. If
not, make your changes
and use Print Preview
again.

Create a form with a
main form and a subform
Try Microsoft Forms II tutorial
You can create a form with a subform on two tables
that have an established relationship.
When the relationship between the tablesis a one-
to-many relationship, the main form will consist of
data from the primary tableand the subform will
consist of data from the related table.
By selecting two related tables in the Form Wizard, you can
produce a form with a subform.
The form with subform is a great way to display data for
tables that have a one-to-many relationship.

Form Wizard Form/Subform
dialog box
Tables or queries used
for the form and
subform display here.
Main form fields
are shown here.
Subform fields
are shown here.

Form and subform data
Notice in the following figure that the main form
contains information about the employer whose ID is
10122.
The data in the subform are positions that this
particular employer has available.
Also notice that you have two sets of navigation
buttons. You can navigate the data for either form.
The outer navigation buttons apply to the main form
The inner navigation buttons apply to the subform

An example of a Form with
subform
The main form
name appears in
the title bar.
The main form.
The subform
navigation bar.
The main form
navigation bar.
The subform.

Relationship of Main/Sub Form
To create a form based on two tables, a relationship
between the two tables must be defined first.
Access Form Wizard automatically divide into
main/subform format.
One (customer) –to –many (Order)
Primary table: Customer (main form)
Related table: Order (sub form)

Creating a Main/Sub Form
Barbara wants you to create a form so that she can
view the data for each customerand all the orders
for the customer at the same time. The form must
have following information: CustomerNum,
CustomerName, OwnerName, OrderNum, Paid,
InvoiceAmt,and BillingDate.
Use the Form Wizard.
Subform layout: Datasheet & Style: International
Save as Customer (main form) and Order (subform)

Creating an Advanced Report
Kim would like to have a more friendly and easy to
read report for senior managers. She needs
following fields fromboth Customer and Order
tables:
CustomerNum, CustomerName, Phone, First
Contact, OrderNum andInvoiceAmt
View by: Customer table, Group by: CustomerNum, and
Sort by: OrderNum field in Ascending order, and Layout:
Stepped
Modify your report…..so, look NICE!!
Save as Customer Orders

Creating Web-Enabled
Information
Barbara feels that other employees in the company
would benefit from gaining access to the Restaurant
Database. Leonard asks whether the database can be
made available to employees over the company
network (I.e., Intranet). That way, employees could
obtain company information using their desktop
computers rather than using paper forms. Most
employees, such as the customer representatives in
the marketing department, do not need to access to
the entire database, nor should they be able to make
changes to the database objects.

Creating a Static Web Page
Leonard has asked you to create an HTML document
for the Customer table. He wants this data to be
available to customer representatives working outside
the office. Leonard wants you to create static Web
pages because the customer representatives need to
view them only once a month to complete their
monthly status reports.
Select the Customertable from Restaurant
Database
File name: Customer
Open the table using any Internet Browser

Creating an Static Web Page
Easy to create and maintain
Stored outside the database
Simple to publish
Only reflect the state of the Customer table at
the time it was created.
Does not allow continuous update because
it’s not linked to the Customer table on which
it is based.

Creating a Dynamic Web Page
(Data Access page)
Barbara asks if it’s possible to create a
dynamic Web page using the Customer
table that her staff members can update
using their browsers.
Use thePages Objects
Save as Customer
A data access page is a dynamic HTML document.

Creating a Dynamic Web Page
(Data Access page)
When you open a data access page, you are
viewing current data from the data access page,
then you can use the data access page to view or
update the data in the database using a Web
browser (at least MS Explorer version 5).
A data access page can be stored outside the
database as separate HTML documents.
If a single table or query is the basis of the data
access page, then you can use the data access
page to update the data in the database.
However, if two or more related tables are the
basis for the data access page, then you can only
view the data (no update).

Importing an Html Document as
an Access Table
Download and then open NewRestHTML
document.
Close NewRestHTML document.
Import NewRestHTML document into
Restaurant database.
Let the Access choose the primary key.
Save as Potential Customers

Importing and Exporting an XML
Document
Download Loans XMLdocument.
Universal way to transmit data because of the Internet
Import LoansXMLdocument into Restaurant
database.
Save as Loans XML
Export Customer table as an XML document
Tags