New Perspectives Access 2016 | Module 2: SAM Project 1a
C:\Users\akellerbee\Documents\SAM Development\Design\Pictures\g11731.pngNew Perspectives Access 2016 | Module 2: SAM Project 1a
Healthy Myles Fitness Center
UPDATING TABLES, ADDING RECORDS, AND CREATING RELATIONSHIPS
GETTING STARTED
· Open the file NP_AC16_2a_FirstLastName_1.accdb, available for download from the SAM website.
· Save the file as NP_AC16_2a_FirstLastName_2.accdb by changing the “1” to a “2”.
· If you do not see the .accdb file extension in the Save As dialog box, do not type it. The program will add the file extension for you automatically.
· To complete this Project, you will also need to download and save the following support files from the SAM website:
· Support_NP_AC16_2a_Clients.accdb
· Support_NP_AC16_2a_Location.txt
· Support_NP_AC16_2a_Billing.xlsx
· Open the _GradingInfoTable table and ensure that your first and last name is displayed as the first record in the table. If the table does not contain your name, delete the file and download a new copy from the SAM website.
PROJECT STEPS
You are employed at Healthy Myles Fitness Center and are in charge of consolidating the company’s records and other important information into a database. You have already set up the basic structure of the database, and you are now updating some information and creating relationships to make information more useful and easier to locate.
Open the tblTrainer table in Design View, and then set the field properties shown in Table 1 on the next page. Be sure to set the TrainerID field as the primary key for the table.
Table 1: tblTrainer Table – Field Properties
Field Name
Data Type
Description
Field Size
Other
TrainerID
Short Text
Primary Key
Caption: Trainer ID
FirstName
Short Text
20
Caption: First Name
LastName
Short Text
25
Caption: Last Name
Interests
Long Text
Add a new field to the table after the Interests field. Use the following options (some of which may already default to the values shown below):
a. Field name: Minors
b. Data Type: Yes/No
c. Format Property: Yes/No
d. Caption Property: Accepts Minors
e. Default Value: No
Delete the College field from the table. Save the tblTrainer table. (Hint: Click the Yes button when warned that you are about to delete one record, and click Yes again if you are warned about potential data loss.) Switch to viewing the tblTrainer table in Datasheet View.
While viewing the tblTrainer table in Datasheet View, move the Interests field to the left of the HireDate field.
While viewing the tblTrainer table in Datasheet View, update the following records to indicate that these trainers will accept clients who are minors: Randy Lee (TrainerID 312), Raj Patel (TrainerID 612), and Carson Garner (TrainerID 708). Save and close the table.
Create a new table in the database with the name tblClient by importing the structure of the tblClient table in the file Support_NP_AC16_2a_Clients.accdb, available for download from the SAM website, into the current database. Do not save the import steps.
Open the tblClient table in Design View, and then update the field properties using the information in Table 2 on the next page. Be sure to set the ClientID field as the primary key for the table. When you have finished, save the tblClient table.
Table 2: tblClient Table – Field Properties
Field Name
Data Type
Description
Field Size
Other
ClientID
Short Text
Primary Key
6
Caption: Client ID
State
Short Text
2
Default Value: NY
Zip
Short Text
10
Phone
Short Text
15
Gender
Short Text
F (Female), M (Male)
1
Switch the tblClient table to Datasheet view, then add the records shown in Table 3 below. Close the tblClient table when you are finished.
Table 3: tblClient Table – Records
Client ID
FirstName
LastName
Address
City
State
Zip
Phone
Birth Date
Gender
A10025
Alfred
Pineda
465 Grant St.
Buffalo
NY
14213
716-555-4815
12/15/1964
M
B10216
Maria
Johnston
701 Washington St.
Buffalo
NY
14203
716-555-9855
2/28/1971
F
Your supervisor exported his existing location data to a text file, and he asks you to add this data to the tblLocation table. Import the data as follows:
f. Specify the file Support_NP_AC16_2a_Location.txt, available for download from the SAM website, as the source of the data.
g. Select the option to append a copy of the records to the tblLocation table.
h. In the Import Text Wizard dialog boxes, choose the option to import delimited data, to use a comma delimiter, and to import the data into the tblLocation table. Do not save the import steps. Open the tblLocation table in Datasheet view to confirm that the data imported properly, then close the table.
Use the Import Spreadsheet Wizard to add data to the tblBilling table from an Excel spreadsheet as follows:
i. Specify the file Support_NP_AC16_2a_Billing.xlsx, available for download from the SAM website, as the source of the data.
j. Select the option to append a copy of the records to the tblBilling table.
k. In the Import Spreadsheet Wizard dialog boxes, choose the Sheet1 worksheet, and then import to the tblBilling table. Do not save the import steps. Open the tblBilling table in Datasheet view to confirm that the data imported properly, then close the table.
Add the tblTrainer, tblBilling, and tblClient tables to the Relationships window. Use the mouse to resize the field list for each table shown in the Relationships window so all fields are visible in the field list. Define a one-to-many relationship between the primary tblTrainer table and the related tblBilling table using the TrainerID field. Choose the options to enforce referential integrity and to cascade updates to related fields.
Define a one-to-many relationship between the primary tblClient table and the related tblBilling table using the ClientID field. Choose the options to enforce referential integrity and to cascade updates to related fields. Figure 1 below shows the completed Relationships window. Save and close the Relationships window.
Figure 1: Relationships Window
Save and close any open objects in your database. Compact and repair your database, close it, and then exit Access. Follow the directions on the SAM website to submit your completed project.
2