More On Database Use: Manipulating The Data in The Database
More On Database Use: Manipulating The Data in The Database
LEARNING OUTCOMES
Lesson 6 introduced you to the database concept in general, and to the Access database
in particular. You learned how to plan a new database, how to set it up, how to add
records, make changes to records, and delete records. You also learned how to save a
database, and how to make backup copies.
It is now time to start using those functions of the database that make it such a
powerful tool for learning--for organizing data resulting from research, for helping you
or your students to work on projects, for personalizing your interaction with students,
and so forth. Some of the exercises cover aspects of database use--rules for finding and
sorting records, for example--which may be difficult for you to grasp. Forewarned is
forearmed; put your thinking cap on!
Lesson 7, then, after reviewing the basics, will introduce you to the following
features of the Access database:
• searching and querying a database
• sorting records
• creating reports
• improving the report (making changes)
• printing reports
A caveat before you begin: You'll find it easiest to use the tutorial if you follow
the directions carefully. On computers there are always other ways of doing
things, but if you wander off on your own be sure you know your way back!
188 ESSENTIAL MICROSOFT OFFICE 2000: Tutorial for Teachers
Copyright © Bernard Poole, Rebecca Randall, 2000. All rights reserved
You should be very familiar with how to open the Microsoft Office Access
program by now, so go ahead and do so
When you are ready you should have the Access Intro dialog box on the screen,
inviting you to either create a new database or open an existing database.
Make sure you have selected the radio button next to Open an existing file
then click on OK
On your WorkDisk, in the Other folder, open the Roster2000 database
Click on the Forms button among the Objects buttons on the left side of the
dialog box and double click to open Form1
You should see the Form View illustrated in Fig. 7.1.
In the Form view, as you can see, the data for one complete record is shown in the
Form. Notice the database navigation tools at the bottom of the Form window (Fig.
7.2). Look them over now to re-familiarize yourself with how they work.
The Datasheet view (Fig. 7.3) shows the records across the screen in rows and
columns much like the Spreadsheets you learned to use in Lessons 4 and 5.
to do so. You will learn how to do this in a later section of this tutorial (7.4 SORTING
RECORDS). You are going to add a couple of new records now.
Make sure you have Form View selected (from the View menu) when you
want to add a new record
In the Insert menu select New Record (or click on the New Record button in
the Navigation tools at the bottom of the Form window (Fig. 7.2) which will
open up a set of empty fields for the new record
Enter the data for this new record, and at least one other, record (two
records in all), pressing the Tab key after you type the data for each field
You can put garbage entries in some or all of the records you are adding because
you will practice deleting them in a moment. For that matter, you can skip a field if you
like by simply pressing Tab without entering any data.
So click in the Nick Name field entry (not on the field name) of the first of
the records you added just now
Highlight the field entry, then from the Edit menu select Cut (ctrl-X)
Next go to the second of the records you added a moment ago and click in
the Clubs field entry
Once again select the entire field entry, and from the Edit menu select Cut
(ctrl-X)
Notice that this does not delete the field or the record; it simply clears the selected
entries. The field is still there, so new data can be entered into it.
Use the Navigation tools to locate one of the records you added a moment
ago
From the Edit menu select Delete Record (or click on the Delete Record
icon in the Access toolbar (Fig. 7.4))
192 ESSENTIAL MICROSOFT OFFICE 2000: Tutorial for Teachers
Copyright © Bernard Poole, Rebecca Randall, 2000. All rights reserved
Access immediately displays a warning dialog box to tell you that if you go ahead
you will permanently lose the data in the record.
Locate a record in which you want to make the change (for this exercise
select any record you like)
Click on the entry next to the field name that needs to be changed (use any
entry in the Nick Name field for this exercise)
Change it to some other nick name in the same way you would in a word
processor
All of the exercises in this section were by way of recapitulating what you learned in
Lesson 6. Now let’s move on to learn some more advanced features of the Access
database.
There are several ways you can do this. But first you need to open a new, larger, file
onto the Access Desktop.
Close the Roster2000 database document and from the File menu select
Open...
Open the file called Birds.mdb (inside the Practice folder on your
WorkDisk), then open the BirdSightings form
Finding a single record using data from a specific field
You often may need to locate and display the contents of one particular record, or set of
records, based on data from one specific field. The function Find, which is in the Edit
menu, is the Access command to do this. It works much the same as when you use the
Find command in the word processor, which you learned about in Lesson 2.
Suppose, for example, you wanted to find the record for the bird with the Common
Name Northern Oriole in the Birds database. Here is how you do this.
First you have to select (by positioning the cursor anywhere in it) the field which
contains the criteria for the search, in this case the Common Name filed
Click anywhere in the Common Name field, then from the Edit menu select
Find (or click on the Find button in the toolbar—Fig. 7.4 above)
Access now displays the Find and Replace dialog box (Fig. 7.5)
You must indicate exactly what data you want found by typing the word or string of
characters that will be the search criteria. The record(s) you find with a find request are
called the –found setÓ.
Click on the More>> button to see other options you can specify to refine the
search
In the Find What: entry box type Northern Oriole (if you do not check the
“Match Case” box, Access doesn't care whether you use upper or lower case
letters)
Click on Find Next then click on Cancel
Access quickly locates the record containing the name "Northern Oriole." This one
record alone is shown on the Form View screen. Of course, if you incorrectly typed
Northern Oriole, Access would tell you that the search item was not found (Fig. 7.6).
Filter by selection
The exercise that follows will use a filter to select the set of birds whose habitat is –
marshesÓ.
Close the BirdSightings Form, then click on the Table button in the Birds
database dialog box and open the BirdSightings Table
Scroll, if necessary, from left to right to locate the Habitat column
Lesson 7: More on database use 195
Now position the mouse arrow near the left edge of one of the marshes
entries (the mouse pointer will become a hollowed out plus sign ( )—Fig.
7.7) and click the mouse button
This tells Access that you want the set of birds who live among marshes.
Click on the Filter by Selection button in the toolbar (or from the Records
menu select Filter/Filter by Selection)
You will now see a list of 15 birds in the database that live in marshes (Fig. 7.8).
Click the Remove Filter button on the toolbar, or from the Records menu
select Remove Filter/Sort to go back to viewing all the records in the
database
Filter by Form
From the Records menu select Filter/Filter by Form or click on the Filter by
Form button in the toolbar
196 ESSENTIAL MICROSOFT OFFICE 2000: Tutorial for Teachers
Copyright © Bernard Poole, Rebecca Randall, 2000. All rights reserved
Fig. 7.9 The Filter window with its Look For and Or tabs
Lesson 7: More on database use 197
But first you need to tell Access that the previous filter (for the birds that live among
marshes) is no longer relevant. Access keeps previous search criteria active unless you
switch them off or remove them from the filter. So you need to remove –marshesÓ
from the Habitat entry box. This is easy enough to do.
Highlight “marshes” if it isn’t already highlighted and hit the Backspace key
You will see an arrow at the right hand edge of the Color1 field (Fig. 7.9 above)
indicating a drop down list.
Click on the arrow that appears on the right edge of the Color1 data entry
box to see the list of the possible colors in the Color1 field (Fig. 7.10)
Click on the color “black” in the list, then click on the first Or in the Look for
filter rule icons at the bottom of the Filter by Form dialog box (Fig. 7.9)
Click on the arrow again to see the list of the possible colors in the Color1
field and in the drop down list click on “blackish green”
Click on the next Or in the Look for filter icons at the bottom left of the dialog
box, click on the arrow again and in the drop down list click on “bluish black”
That is all the colors in the Color1 field that have black in them.
Now click on the Apply Filter button in the Access toolbar (or select Apply
Filter/Sort from the Filter menu)
Immediately Access filters out the set of birds with black in their plumage (Fig. 7.11).
198 ESSENTIAL MICROSOFT OFFICE 2000: Tutorial for Teachers
Copyright © Bernard Poole, Rebecca Randall, 2000. All rights reserved
Click on the arrow that pops up to see the drop down list of all dates on
which birds were sighted
Click on the first date which has a ‘9’ for the month (September)
After you click on it, you’ll see the first date in the entry box with ‘#’ symbols
around it to indicate its selection by the filter.
Click on the first Or tab, then click on the arrow in the Date Sighted box
again and select the second date with a ‘9’ for the month
Now click on the Apply Filter button in the toolbar
How many records did you get? There should be 12.
What if you wanted to print out a report listing all the birds in alphabetical order by
name of bird? You would have to first organize the records alphabetically on the bird
names. Fortunately Access has a Sort Records... function which enables you to complete
this operation with the greatest of ease.
First you need to remove the filter you used to select the set of birds sighted in
September.
You can best see the results of a sort if you are in the Datasheet view of the database,
which is the view you should have on your screen. If you do not have the Datasheet
View, select it now from the View menu before proceeding.
Immediately Access sorts the records alphabetically on the Common Name field.
There are other sorting options depending on the type of data in the field you are using
as the basis, or key, for the sort:
• If your sort request is based on a Text field such as Common Name or Location
Sighted, the sort will be either Ascending (A to Z) or Descending (Z to A).
• If you are sorting on a Number field such as the Count field, you would be able to
sort in Ascending (Low number to high number) or Descending (High number to
low number) order.
• Finally, if you are sorting on a Date field such as Date Sighted, you would be able
to sort in Ascending (Chronological) or Descending (Reverse Chronological)
order.
Lesson 7: More on database use 201
Click in the Family field, then click on the arrow to see the drop down list of
all possible families of birds
Click on Duck then click on the Apply Filter button in the toolbar
202 ESSENTIAL MICROSOFT OFFICE 2000: Tutorial for Teachers
Copyright © Bernard Poole, Rebecca Randall, 2000. All rights reserved
Next click the little arrow next to the Objects button at the end of the Access
toolbar (Fig. 7.13) to show the drop down list of database objects, and click
on the Report icon
Fig. 7.13 The Report object in the database objects drop down list
You have to save the Table before you can work on it, so click on Yes in the
dialog box that pops up on the screen
This brings up the New Report dialog box.
In the New Report dialog box select Report Wizard (Fig. 7.14) and select
the BirdSightings table as the source for the report’s data, and click on OK
Access now asks you in a new dialog box if you want to add any grouping levels to
the report.
You don’t want to add any grouping levels, so click on the Next button again
to by-pass this dialog box
In the next dialog box you are asked if you want to sort the records. There is no
need to do this since you already sorted them in Ascending order on the Common
Name
Click on Next once more to proceed to the next step in the Report Wizard
The default setting for the report layout is Tabular, which is what you want.
Click on the Next button, then select Compact for the style of the report in
the next dialog box (Fig. 7.16 on previous page) and click on Next
In the next step of the Report Wizard you have to enter the title for the report (Fig.
7.17).
For the Title of the report, type Count of Ducks Sighted, then click on the
radio button next to “Modify the report’s design”
You need to select this option to modify the report’s design since, as you will see
shortly, you need to rearrange the headers and fields so they fit nicely on the page of
the report.
Click on Finish
The Modify window for the report has five sections to it: a Report Header section, a
Page Header section, a Detail section (where the data will be listed), a Page Footer and a
Report Footer.
In the Page Header section, the Common Name column looks about right, so there’s
no need to change it. The space allowed for the Family column, however, is much
wider than necessary.
Click once on the Family Page Header so you get the handles around it
Now grab one of the handles on the right edge and drag the box to the left till
it is only a little wider than the header Family itself
Do the same with the Family box in the Detail section of the report
Click now on the Date Sighted Page Header (part of the header is
truncated), grab one of the handles on the left, and stretch the box so it is
wide enough to show the whole Date Sighted Page Header
Next position the mouse arrow along the bottom edge of the Date Sighted
Page Header box so the arrow changes to a small black hand, and drag the
box to the left so it ends up close to the Family Header box
Now do the same to the Date Sighted Detail box
Next, grab the Count Page Header box and the Count Detail box and slide
them over so they are next to the Date Sighted boxes
Your last task is to center the report title.
Click on the title Count of Ducks Sighted
Position the mouse arrow along the lower edge of the box till the arrow
changes to a small black hand, then drag the title to the right till it is
centered over the columns of the report
When you are done, the Design View for the report should look like Fig. 7.20.
Fig. 7.20 The final Design View of the report after modifications
Lesson 7: More on database use 207
From the View menu select Print Preview to check out the appearance of
your report.
It should look similar to that illustrated in Fig. 7.19. If you need to go back and do
some more modifications to the report, just go back to the View menu and select Design
View.
Click on the Print button at the top of the Print Preview window to print the
Count of Ducks Sighted report
Remove the report from the printer and take a closer look at its contents. Notice that
the only records in the report are those relating to ducks in the Family field. These are
just a small subset of records drawn from the larger Birds database.
LOOKING BACK
The Access database is a sophisticated tool for managing data. The key to success, as in
so many activities, is PLANNING. Computers are wonderful tools to assist us in our
professional lives, but only if we bring our intelligence to bear. The more skillful the
user, the more powerful the impact of the computer on our professional and non-
professional productivity.
You practiced three important skills of database management in this tutorial:
1. You learned how to search and query a database so that, no matter how large it
might be, you could easily and quickly get the answers to any questions you
might have. Getting answers to questions, research and so forth, is what creating
electronic databases is all about.
2. You learned how to sort a database, and select out subsets of records.
3. You learned how to create and print new layouts or reports based on the data in
a database.
Perhaps you have already learned about the value of database management systems
such as Access in the educational process. databases are the electronic storage bins for
knowledge. Today they are both local and global in scope. More and more data is
becoming available for on-line research. In time, maybe 50 years from now, maybe less,
all knowledge will be accessible electronically. In the meantime, as teachers we should
208 ESSENTIAL MICROSOFT OFFICE 2000: Tutorial for Teachers
Copyright © Bernard Poole, Rebecca Randall, 2000. All rights reserved
become aware of just what is available to our students, and do what we can to educate
them to take advantage of information services of all kinds.
The role of teachers is changing. We are no longer the source of all knowledge.
Rather, we are "knowledge brokers," intermediaries between our students and the
source of the data they need so that they can "grow in wisdom and knowledge." As
someone has observed, "Teachers should move away from being sages on the stage, and
become, instead, the guides at the side."
LOOKING FORWARD
There is more to learn about the Access database. It is beyond the scope of this book to
cover all of the features of the software. However you have certainly learned the
fundamentals and have the tools now to make a database work for you and for your
students. The exercises that follow in the SKILL CONSOLIDATION section will help
you reinforce the knowledge you have gained.
"Practice makes perfect" is as true of computer use as it is of any other skill-based
activity like playing tennis or baking a cake. So is that other saying: "Use it, or lose it."
You can probably identify many examples from your own experience where skills you
were once proud to have mastered have become 'rusty' for lack of use. Likewise, you
will quickly forget what you are learning in these tutorials unless you resolve to
continue to apply the lessons learned on a regular basis, either for your own work or in
the context of the classroom.
The best teachers will use all the help they can get. The purpose of these tutorials
continues to be to sharpen your skills in the use of one of the most powerful classroom
tools yet devised--the electronic computer. You are to be congratulated for having
persevered thus far. The remaining two tutorials will help you integrate the skills you
have learned, and hopefully spur you on to a commitment to continue to incorporate
the computer into your professional life both for your own sake and for that of your
students.
SKILL CONSOLIDATION
Complete as many of these exercises as you can to reinforce what you learned in Lesson
7.
1. Work with a group of your colleagues or classmates to specify and create a series of
reports to accompany a database of student data such as the Roster Template
database that you created in Lesson 6. Save the template with the set of reports.
2. Open the Roster2000 database onto the Desktop.
• Add a record
• Change the address and phone # in an existing field
• Arrange the records chronologically on date of birth
3. Create a database of your choosing.
Lesson 7: More on database use 209