Access Lab Spa

9
8/3/2019 Access Lab Spa http://slidepdf.com/reader/full/access-lab-spa 1/9 CIS 300 Access Lab Assignment You have been given the following three tables in Spa database. 1. tblClients 2. tblPackagesPurchased 3. tblSpaPackages 1. Task 1- Create a Form a. Design a form to edit/add client information In Menu item > More Forms chose Form Wizard to create a form for the tblClients table. The form will be used to edit data or add new clients to the database. Include all fields for the form. Use the columnar layout and Office style. Title the form frmClientInformation. This will be similar to the following. Task 2 - Create relationship diagram Use Relationships in the Database Tools menu to create relationships between all three tables. Relate Client ID field in tblClients with the Client ID field in the tblPackagesPurchased and relate Package ID field in the tblSpaPackages with the Package Purchased in the tblPackagesPurchased. Right click on a relationship line and

Transcript of Access Lab Spa

Page 1: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 1/9

CIS 300

Access Lab Assignment

You have been given the following three tables in Spa database.

1.  tblClients

2.  tblPackagesPurchased

3.  tblSpaPackages

1.  Task 1- Create a Form

a.  Design a form to edit/add client information

In Menu item > More Forms chose Form Wizard to create a form for the tblClients table.

The form will be used to edit data or add new clients to the database. Include all fields for

the form. Use the columnar layout and Office style. Title the form frmClientInformation.

This will be similar to the following.

Task 2 - Create relationship diagram

Use Relationships in the Database Tools menu to create relationships between all

three tables. Relate Client ID field in tblClients with the Client ID field in the

tblPackagesPurchased and relate Package ID field in the tblSpaPackages with the

Package Purchased in the tblPackagesPurchased. Right click on a relationship line and

Page 2: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 2/9

Page 2

Edit the relationship. Click on “Enforce Referential Integrity” box. The relationship

should look like the following. Save and close the Relationship window.

Task 3 - Create Queries

Kasey is thinking of offering a “Young Again” spa package that would include various skin

treatments and massages. To get an idea of how much interest there would be in this

package, you are being asked to create a listing of clients over the age of 40. She does not

need a formal report. You decided the easiest way to do this is to filter the table and print

the filtered sheet.

a.  Create a query in Design View

a.  Crosstab query

a.  In Create menu click on Design Query. Include all three tables. Add the Last Name,

First Name, Package Purchased, Package Name, and Package Price fields to the query

design grid. Save the query as qryPackageSales. This is similar to the following.

Page 3: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 3/9

Page 3

And the datasheet view will be similar to the following.

b.  YoungAgain Query: Create a query to list client over 40 years (birth date prior to

6/15/1969).

In Create menu click on Design Query. From tblClients include Last Name, First Name,First Name, Street Address, City, State and Zip Code, and Birthdate to the query design

grid. Enter <6/15/1969 in the Criteria field Birthdate. See figure below.

Page 4: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 4/9

Page 4

And the query (in datasheet view) will be similar to the following.

Save the query as qryYoungAgain.

c.  Crosstab Query: In Create menu click on Query Wizard and choose Crosstab Query

Wizard based on the qryPackageSales query. Select Last Name as the row heading,

Package Name as the column heading, and Package Price as the field you want

calculated with the SUM function. Name the crosstab query qryClientPurchases.

Page 5: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 5/9

Page 5

Adjust the column widths. Rename the Total of Package field “Total Purchases”. To do this

switch to the Design View. Click anywhere on the last field titled “Total of Package Price”.

Right Click and choose Properties from the list. Type the new name “Total Purchases”

(without the double quotes) in the Caption. Close the Properties box. Run the query to

verify the change. Move the field to the last position in the crosstab. Save the query as

qryClientPurchasesCrosstabs. Your query should be similar to the following.

Task 4 - Create a Form and subform

Create forms for two related tables (such as display tracks for an album for a database for

music collection; display multiple orders for a given customer; list several items for a given

order; etc.)

Kasey has asked you to create a form that will enable users of the database to update

information about the spa packages as well as the clients who have purchased each

package. This will require you to create a multiple-table form using fields from all three

tables in the database. Kasey would like this new form to enable users to quickly access

the existing Client Information form so they can update it when necessary. You will

provide this access via a command button that links the two forms.

To create the form, follow these steps:

a.  Open the Spa database file.

Page 6: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 6/9

Page 6

b.  In Create Menu choose More Forms > Forms Wizard to create a new form using:

1)  all fields from the tblSpaPackages table;

2)  the Client ID, First Name, and Last Name fields from the tblClients table;

3)  the Package Purchased field from the tblPackagesPurchased table.

Specify that you want to view the data by tblSpaPackages table. Use theDatasheet layout for the subform and the Office style. Name the form

frmSpaPackages and the subform frmPackagePurchasers. Open the form in

Form view. Adjust the column widths and your form should be similar to the

following for Record 3

Form frmSpaPackagesPurchases should display something similar to:

Page 7: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 7/9

Page 7

and frmPackagePurchasers should display something like the following.

Task 5 - Reports

Objectives:

1.  To prepare a report using fields from multiple tables.

2.  Printing Reports

Kasey has requested a report that shows the spa packages that were purchased and by

whom as well as the sales total for each page and the total income generated from these

sales. The report will include group calculations as well as a calculated control that will

generate the grand total.

a.  Open the Spa database.

b.  In Create menu, use the Report Wizard to create a new report that contains all fields

(Package ID, Package Name, Package Description, and Package Price fields) for thetblSpaPackages table; the Client ID for the tblPackagesPurchased table; and the First

Name and Last Name fields from the tblClients table. Specify you want to view the

data by tblPackagesPurchased and group the report by Package Name. Do not sort on

any fields. Open the Summary Options and select the Sum option for the Package

Price field. Use the Outline layout and the Office style. Name the report

rptSpaPackagesPurchased and finish out of the Wizard.

c.  Switch to Report Design view and your report design should be similar to the

following.

Page 8: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 8/9

Page 8

d.  Fix the spacing problems. For example, to make more room, you can rename the

Package ID to ID; Package Price to Price; and Client ID controls to Client. Move the ID

controls to the left margin to extend the amount of space you have to work with; and

increase the width of Package Description controls so more of the text can be

displayed. Size the other controls appropriately and left align the text controls.

Extend the horizontal lines above and below the labels to accommodate your changes

as necessary.

e.  Make further enhancements to the report layout as desired (text color, font size, style,

and special effects). When you are finished, return to Report view and print the

report, save it and close it.

The first page of the report should be similar to the following.

Page 9: Access Lab Spa

8/3/2019 Access Lab Spa

http://slidepdf.com/reader/full/access-lab-spa 9/9

Page 9

… and the last page (Page 3) should be similar to the following.