Download as a Word document: Hands-On Exercise Ch05 (195.0K) Traverse Bay Parasailing: Customer DataIn this exercise you will be modifying a table in design view,
setting default values, caption property, format and input
masks. - Open the file AC05HO01. You Screen should look similar to
Figure 5-1.
(52.0K) Figure 5-1 - Open the 1 Customers table in datasheet view and review the
records that are already entered. When you are finished close
the datasheet window.
- Lets edit the field properties in the customer table.
SELECT: 1 Customers
CLICK: Design button on the Database window toolbar. - 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.
- To format the state characters so they will always be
capitalized:
SELECT: Format text box
TYPE: >
(greater than symbol)
- Set the default value to MI:
SELECT: Default value text box
TYPE: MI - 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.) - 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 - 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.
- Switch back to design view. On your own, set the same input
mask for the FaxNumber field.
- Switch to datasheet view again to see the results of the
change. Answer yes if asked to save the changes first.
- 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.
- 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. - Open the file AC05HO01. You Screen should look similar to
Figure 5-1 above.
- 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.
- Open the relationship window:
CLICK: Relationship button on the database toolbar. - 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 - You may want to rearrange the tables in the window similar
to Figure 5-2
CLICK: a table title bar
DRAG: to new location (56.0K) Figure 5-2 - The first relationship is between Divers and DiverInterest:
CLICK: DiverID in the 2 Divers table, and
DRAG: to DiverID in the 2 DiverInterest table - 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. - On your own create the relationship between the Interests
and the DiverInterest tables, using the same properties as the
previous step.
- When finished, your relationship window should look similar
to Figure 5-3
(47.0K) Figure 5-3 - When finished, close the relationship window, save the
changes. Close the database and close Access.
Hands-On Exercises Data Files Ch05 (31.0K) |