Professional Documents
Culture Documents
2. Have performed the following steps in the Video Rental System development:
Become familiar with the existing tables and the relationships between them.
Enhanced the existing user interface for entering and editing member details.
Created a new form for entering and editing details video category details.
3. Be able to explain:
The purpose of relationships between tables in a database.
The advantages of using a form to interact with data in a database compared
with using the tables directly.
1
1.2 Exercises
Start File: VideoStore.mdb
2
What do the columns represent?
________________________________________________________
5. Use the following questions to help you explore the other tables:
How many different video titles are contained in the Video Rental System
________________________________________________________
What different types of videos are available for rental?
________________________________________________________
What categories are the videos grouped into?
________________________________________________________
Which videos are currently on loan?
________________________________________________________
Which is latest video to be hired? When is it due back?
________________________________________________________
Relationships
In order to access the database effectively and produce useful information, it is necessary for
the database tables to be “related”, i.e. linked together. For example, each given Hire is made
by a particular Member and each video belongs to a particular Category.
Therefore, there are relationships between the Hire and Member tables, and the Video and
Category tables.
3
Figure 1.2: Video Rental System database relationships
6. View the relationships in the Video Rental System database (refer to Figure1.2). From
the menu select Tools Relationships:
How many tables are there in the database?
_____________________________________________________________
What do the “1” beside the Member table and the infinity sign beside the Hire table mean?
___________________________________________________
Why is the Member_ID included in the Hire table as well as in the Member table?
____________________________________________________________
7. Use the following questions to help you gain a fuller understanding of the purpose of
the relationships established between the tables:
What is the type of the film titled “Gladiator”?
_____________________________________________________________
What is the category description for the “Star Wars” videos?
_____________________________________________________________
4
What is the name of the member that is involved in hire number 150?
__________________________________________________________________
Data Entry
One way to enter data into the database is by entering it directly into the tables.
8. Enter your details into the Member table. What happens if you try to use a Member
number that already exists?
_______________________________________________________________
9. Enter the new video titles in Table 1.1. On the Category and Type fields, there are drop
down boxes (known as lookups) to help you link the Category and Type numbers with
their respective descriptions. Notice that when you create a new record (i.e. enter a new
row), the Video Code field restricts you to a particular format (try entering a character)
and the Available field is automatically given a default value.
10. Can you see any potential problems with entering data directly into the tables?
5
In this section, you will explore the facilities of an existing form; in later sections you will
modify an existing form and create new forms.
1. Switch to the Forms tab of the database window.
2. Open the Member form (refer to figure 1.3)
3. Explore the Member form and familiarise yourself with the following:
Navigating between records. How can you go straight to the first or last record?
Entering new records.
Deleting existing records.
Using the Find feature (Edit Find) to search on given fields. For example
searching for a member with the member number 15 or surname “Simpson”.
4. Think back to Question 10 of the previous section. What are the advantages of using
forms to interact with databases, rather than interacting directly with the tables?
6
Investigate a form in design mode
In Microsoft Access, a form is constructed from different objects. There are three object groups
that are significant to the work you will be doing: controls, sections of the form, and the form
itself. For descriptions and examples, of these objects refer to Table 1.2. Each type of form
object contains properties that govern their behaviour and appearance.
7
2. View a field's properties by right-clicking on the text box (e.g. Title text box) and
selecting “Properties”. Note how you can have a list of all the properties displayed at
once, or by category. Use the following questions to help you explore the properties
window:
Which properties would you use to change the font of the text box to italic?
_________________________________________________________________
How would you make a text box invisible?
_________________________________________________________________
How would you centre text in a text box?
_________________________________________________________________
3. Use the online help to further explore the different text box properties by selecting a
property and pressing F1. What is the purpose of each of the following properties:
Back Style?
_________________________________________________________________
Special Effect?
_________________________________________________________________
Enabled?
_________________________________________________________________
Locked?
_________________________________________________________________
4. Use the drop down box at the top of the properties window to switch to the form
properties. What is the purpose of each of the following properties:
Navigation Buttons?
_________________________________________________________________
Record Selector?
8
_________________________________________________________________
Allow Additions?
_________________________________________________________________
Data Entry?
_________________________________________________________________
5. Under what circumstances would you set the Data Entry property to “Yes”?
_________________________________________________________________
Note: Notice that a black square appears at the top left of the form when the form
properties are displayed. A shortcut to display the form properties is to double click on this
square.
Improving a form's tab order
6 . Run the form (i.e. switch to form view) to discover the tab order. Once the form is open,
select one of the fields and press the tab key. Cycle through all the fields. Does the form
have a logical tab order?
7 . Switch to design view and create a sensible tab order i.e. tabbing top to bottom and left
to right, by using the Tab Index property of the text boxes (alternatively, select Tab order
from the view menu). When would it be appropriate to use the Tab Stop property?
__________________________________________________________________
Improving a form's appearance
8 . Make the following modifications to the Labels displaying the names of the fields (refer
to Figure 1.5):
Change the font to “Arial”.
Change the font style to “Bold”.
Add a colon at the end of each label.
Right align the text.
9
Figure 1.5: Member form with modifications to the labels and text boxes
9 . Make the following modifications to the Text Boxes displaying the data presented on
the form (refer to Figure 1.51):
Change the font to “Arial”.
Change the background colour to an appropriate light shade.
Change the foreground colour to a pleasing colour (optional).
10 . Use the following steps to add a title to the form:
(a) Enlarge the form's Form Header section.
(b) Use the toolbar to place a Label in the Form Header and set the label's caption
to “Member's Details”. Refer to Figure 1.6 for an example of how this should look.
(c) Set an appropriate font, size, style, alignment, and colour for the new title.
1
The changes to the forms colours can not be clearly shown in the illustration.
10
11. Using the appropriate property of the Form Header and Details sections, set an
appropriate background colour for the form.
12. Complete the improvements to the form by making the following changes to the form
properties:
Change the form’s Caption (the title bar text) to Video Rental System Member's
Details Form.
Remove the Record Selectors and Dividing Lines. What disadvantages are there
in doing this?
____________________________________________________________
Make the necessary modifications so the form has no Scroll Bars.
11
4. Verify the new combo box is functioning as expected.
5. Modify the appearance of the combo box to be consistent with the other controls on the
form.
1.2.5 Review
In this week's laboratory session you have:
1. Explored how information for a system can be stored in multiple tables that are related
to one another.
2. Explored how forms can make it easy for the user to manipulate data stored in tables.
3. Familiarised yourself with the different types of objects that make up a form and how
their properties can be customised to meet the needs of the user.
END OF LAB. 1
12