Microsoft Access is a software application that could help students to create databases and organize data using database tools like, reports, modules, tables and queries. Database Relational is a tool that could organize the data by its relationship (One is to One, One is to Many and Many is to Many.
2. 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.
3. Relational Database
A schematic diagram of a relational database (a) and a sample part of a
relational database showing different tables (b)
4. Open an existing database
īŽ Create a folder by your last name in My
documents or on Desktop
īŽ Download âRestaurant1â database into the 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.
5. 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.
6. 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)
7. Primary Key (PK) & Foreign Key (FK)
īŽ PK: A field that uniquely identifies each record in a
table.
īŽ SS#, Student ID
īŽ 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
8. 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.
9. 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 1 to 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.
10. 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 table that is in Excel format
and you will import it, and then convert to Access
table.
11. 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.
12. 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.
13. Access data (field) type
Make certain the field type you select matches the data to be held in that field.
15. 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
16. 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 BillingDate PlacedBy InvoiceAmt
323 624 02/15/2001 Mike Smith $1,986.00
201 107 01/15/2001 Matt Davis $854.00
17. Modifying a Table
īŽ From the Order table
īŽ Delete the PlacedBy field
īŽ Move the BillingDate field to the end of the table
īŽ Insert the Paid as a new field between CustomerNum and
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
18. 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.
19. 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 Product table.
(Hint: You must type the decimal point when entering the Price field
values.)
Field Name Data Type Description Field Properties
ProductCode Text Primary Key Field size (4), Required: Yes
CoffeeCode Text Foreign Key Field size (4)
Price Currency Price for this product
Decaf Text D if decaf, Null if
regular
Field size (1), Default Value: D
BackOrdered Yes/No back-ordered from
supplier?
Default Value: No
20. Practice: Modifying a 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
21. Practice: Updating a Table
īŽ 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
22. Data Integrity (PK Rule)
īŽ No ânullâ value can be allowed.
īŽ No two records can have the same primary key.
īŽ No two CSUB students can have same ID number.
īŽ A PK can 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#
23. Referential Integrity (FK Rule)
īŽ A field that connects one table logically with another
table.
īŽ Exception example on class web page
īŽ âPK as FKâ there are two tablesâĻ
īŽ Related table: Shipping Address table
īŽ Primary table: customer table
24. Importing External Access Table and
Excel Worksheet
īŽ Barbara also wants you to include the Product and
Order Detail tables from the FineFood database in
the Restaurant database.
īŽ Download and Review design view of FineFood
DB first
25. 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.
26. 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 names between tables.
īŽ Tables can be joined in three ways; one-to-one, one-
to-many, and many-to-many.
27. 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.
28. 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
29. 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.
30. 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
īŽ Try Referential Integrity Example DB on the class
web page.
31. Creating Relationships
īŽ Download Restaurant2 file from the class web
īŽ Create relationships using 5 table
īŽ In terms of creating a relationship between Customer and
BillingAddress, start from the Customer table.
īŽ Enforce both cascade options
īŽ Primary key of the Order Detail table
īŽ Combination of OrderNum and ProductCode
īŽ Otherwise, a duplication of the quantity field in both the
Order and Product tables.
32. Practice: Creating Relationship 1
īŽ 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
33. Practice: Creating Relationships 2
īŽ Establish relationship based on common fields.
īŽ And enforce referential integrity (apply both options)
among three imported tables
34. What is an Access query?
īŽ You can create a query when you need ONLY a portion of the
data form 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 used to specify the fields and records you
want to see.
35. 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.
36. 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, and Phone.
īŽ Use restaurant 3 database
īŽ Save the query as First Customer List.
37. OrderNum CustomerNum Paid InvoiceAmt 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 State ZipCode OwnerName Phone FirstContact
000 Choi COB 105 CSUB CA 93311 Scott Choi 5348 09/20/2001
CustomerNum BillingName Street City State Zip
129 Sandy Lookout
Restaurant
PO Box 2800 Grandville MI 49468
38. 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.
39. Creating Queries using
Multiple Tables
īŽ Since there have been some major changes in the
Restaurant database, 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)
40. 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 InvoiceAmt field in ascending order.
īŽ Barbara also wants to move the Paid field between
the State and BillingDate field.
īŽ Save as Customer Orders
41. Words begin or end with a: LIKE a* or LIKE *a
Find between values: (NOT) BETWEEN 45000 AND 78000
Find exact match value: 1/10/2005
Expressions
42. Find an 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
43. 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
Number must be sorted in ascending order.
īŽ Save as Customer Name Begins With M
44. 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.
45. 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
46. Using And and Or Operators
The And
condition.
The Or
condition.
47. 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.
48. 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 query again and make
sure that this query includes following fields;
CustomerName, Paid, BillingDate, and
InvoiceAmt.
īŽ 01/15/2001 AND unpaid (No)
īŽ Save as Unpaid Jan Orders
49. 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 ) OR who 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.
50. Using OR
īŽ Make sure that this query includes following fields;
CustomerName, InvoiceAmt, and First Contact.
īŽ He also wants to have a sorted output in
ascending order based on the customer name.
īŽ If you want, you can use the Customer Orders
query again
īŽ Save as Top Customers
51. 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.
53. 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â
54. 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
55. 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
amount for all orders, the average invoice
amount, and the number of orders (same as
number of invoice amount). She asks you to
create these statistics.
56. 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.
57. 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
58. 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 each month (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
59. 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
60. Query Practice 1
īŽ Download a database: âRoadrunnerâ
īŽ I would like to have a query that includes following
fields; Employee Number, Instructor Last Name,
Instructor First Name, Course Name and Time.
īŽ Save as Your Course Info.
īŽ I would like to have a query that ONLY includes the
male members who live in Burbank using following
fields; First Name, Last Name, Gender, City, and
State.
īŽ Save as Males in Burbank.
61. Query Practice 2
īŽ I would like to know a list of all members whose last
name begins with P using following fields; First
Name, Last Name, City, and State.
īŽ Save as Last Names begin with P.
62. Query Practice 3
īŽ I would like to know ONLY the Employee 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 in order from
high salary to low salaries.
īŽ Save as Between Salaries.
63. Query Practice 4
īŽ I would like to know the Class Number, Last Name,
and Member Number for each member who has a
class number greater than or equal to 8900. In
addition, sort last names in ascending order.
īŽ Save as Greater than or equal to 8900.
64. Query Practice 5
īŽ I would like to know a list of all members whose last
name that begins with A or a first name that begins
with R including the following fields: First Name, Last
Name, City, and State.
īŽ Save as Names with A or R.
65. 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 First Name, Instructor Last Name,
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
66. 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
67. 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
68. 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.
69. Creating a Form
īŽ After Kim leaves for her staff meeting, Barbara asks you to
create a form for the Customer table because the staff are not
allowed to access the database directly. The staff 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
70. 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).
71. 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.
72. Modifying a Form (conât)
īŽ Put a space between words for followings:
īŽ CustomerName, OwnerName, and FirstContact
īŽ Change CustomerNum to Customer No
īŽ Change Phone to Phone Number
īŽ Add a label in the Form Header section in order to
create a title of this form. The title (use label button
from the Toolbox) for the form should be
Customer Data Entry Form.
īŽ The font size of the title should be a minimum of 20
and the title must be centered.
73. Forms Practice
īŽ Create a form for the Membership Table from 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
74. 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.
75. 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.
76. 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.
77. Creating a Report
īŽ Kim returns from her staff meeting with another request.
īŽ She wants to have a list of OrderNum, CustomerNum,
Paid and 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
78. Modifying a Report
īŽ Insert CSUB logo upper-right corner of 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 words for followings:
īŽ OrderNum
īŽ CustomerNum
īŽ InvoiceAmt
79. Modifying a Report (conât)
īŽ Change order Num to Order No
īŽ Change Customer Num to Customer No
īŽ Change InvoiceAmt to Invoice Amount
īŽ Widen out the heading names and field entries so
that nothing is cut off. Space out your data fields
as well. Also, adjust vertical alignment of
each field. All words in the report must be clearly
visible.
80. 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 Course Table, your report will include
Class Number, Course Name, and Time.
īŽ You need to group by Employee Number. Class
Number should be sorted in ascending order.
The report is called Teaching Assignments.
81. 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 out your data
fields. All words in the report must be clearly
visible.
82. 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.
83. 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 tables is a one-
to-many relationship, the main form will consist of
data from the primary table and 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.
84. 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.
85. 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
86. 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.
87. 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)
88. Creating a Main/Sub Form
īŽ Barbara wants you to create a form so that she can
view the data for each customer and 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)
89. Creating an Advanced Report
īŽ Kim would like to have a more friendly and easy to
read report for senior managers. She needs
following fields from both Customer and Order
tables:
īŽ CustomerNum, CustomerName, Phone, First
Contact, OrderNum and InvoiceAmt
īŽ 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
90. 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.
91. 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 Customer table from Restaurant
Database
īŽ File name: Customer
īŽ Open the table using any Internet Browser
92. 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.
93. 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 the Pages Objects
īŽ Save as Customer
īŽ A data access page is a dynamic HTML document.
94. 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).
95. Importing an Html Document as
an Access Table
īŽ Download and then open NewRest HTML
document.
īŽ Close NewRest HTML document.
īŽ Import NewRest HTML document into
Restaurant database.
īŽ Let the Access choose the primary key.
īŽ Save as Potential Customers
96. Importing and Exporting an XML
Document
īŽ Download Loans XML document.
īŽ Universal way to transmit data because of the Internet
īŽ Import Loans XML document into Restaurant
database.
īŽ Save as Loans XML
īŽ Export Customer table as an XML document