McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Glossary
Data Files
Buzz in IT
Learning Objectives
Chapter Outline
Prerequisites
Multiple Choice Quiz
Short Answer
True or False
Case Problems
Hands-On Exercises
Feedback
Help Center


Advantage Series MS Office XP Access 2002
Advantage Series: Microsoft® Access 2002
Sarah Hutchinson-Clifford
Glen Coulthard

Working With Tables

Hands-On Exercises

Download as a Word document: Hands-On Exercise Ch05 (195.0K)

Traverse Bay Parasailing: Customer Data

In this exercise you will be modifying a table in design view, setting default values, caption property, format and input masks.

  1. Open the file AC05HO01. You Screen should look similar to Figure 5-1.
  2. <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=jpg:: ::/sites/dl/free/0072470925/26861/ch05_hoe_image01.jpg','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (52.0K)</a>

    Figure 5-1

  3. Open the 1 Customers table in datasheet view and review the records that are already entered. When you are finished close the datasheet window.
  4. Lets edit the field properties in the customer table.
    SELECT: 1 Customers
    CLICK: Design button on the Database window toolbar.
  5. The majority of customers are from the state of Michigan. Therefore, we will specify MI as the default value. Also, since we will be using the two letter state abbreviation set the field size to two.
    CLICK: row selector button for state
    SELECT: Field size by clicking in the text box for field size, to the right of the 0 in 20
    PRESS: Backspace to delete the 0.
  6. To format the state characters so they will always be capitalized:
    SELECT: Format text box
    TYPE: >
    (greater than symbol)
  7. Set the default value to MI:
    SELECT: Default value text box
    TYPE: MI
  8. Now lets set an input mask for the phone and fax numbers:
    SELECT: the row selector for PhoneNumber
    CLICK: Input mask text box
    CLICK: Build button (If asked to save the table, answer Yes.)
  9. SELECT: Phone Number input mask
    CLICK: Next
    Since we are not using area codes, you will need to modify the input mask:
    SELECT: !(999) in the Input mask text box
    PRESS: Delete
    CLICK: Finish
  10. Switch to datasheet view to see the changes. Notice that the new record shows MI entered already, and the phone numbers now have a dash.
  11. Switch back to design view. On your own, set the same input mask for the FaxNumber field.
  12. Switch to datasheet view again to see the results of the change. Answer yes if asked to save the changes first.
  13. Enter your own name and information into a new record. Notice that MI is automatically entered for the state. You can change it when you enter your state.
  14. When finished, close the datasheet view window. Close the database.

Find-A-Buddy Dive Club

In this exercise you will practice defining a many-to-many relationship by specifying two one-to-many relationships. The tables are Divers, Interests and DiversInterest that will have relationships defined in the relationship window.

  1. Open the file AC05HO01. You Screen should look similar to Figure 5-1 above.
  2. Each diver may have several types of diving he or she like to participate in. Since there are a variety of different interests, there may be several divers who are interested in that activity. In other words, a diver may have many interests, and each interest may have many divers. In order to define this Many-to-many relationship, we use an intersecting table that combines the Divers and Interests.
  3. Open the relationship window:
    CLICK: Relationship button on the database toolbar.
  4. To select the three tables to be joined by relationships:
    CLICK: 2 DiverInterest
    PRESS: Shift and hold down while:
    CLICK: 2 Interests
    CLICK Add command button
    CLICK: Close command button
  5. You may want to rearrange the tables in the window similar to Figure 5-2
    CLICK: a table title bar
    DRAG: to new location
  6. <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=jpg:: ::/sites/dl/free/0072470925/26861/ch05_hoe_image02.jpg','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (56.0K)</a>

    Figure 5-2

  7. The first relationship is between Divers and DiverInterest:
    CLICK: DiverID in the 2 Divers table, and
    DRAG: to DiverID in the 2 DiverInterest table
  8. In the Edit relationships dialog box:
    CLICK: Enforce Referential Integrity check box
    CLICK: Cascade Update Related Fields check box
    CLICK: Cascade Delete Related Records check box
    CLICK: Create
    Notice the relationship type is one to many.
  9. On your own create the relationship between the Interests and the DiverInterest tables, using the same properties as the previous step.
  10. When finished, your relationship window should look similar to Figure 5-3
  11. <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=jpg:: ::/sites/dl/free/0072470925/26861/ch05_hoe_image03.jpg','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (47.0K)</a>

    Figure 5-3

  12. When finished, close the relationship window, save the changes. Close the database and close Access.
Hands-On Exercises Data Files Ch05 (31.0K)




McGraw-Hill/Irwin