Module 5 Access XPv1
Module 5 Access XPv1
Computer Driving
Licence ®
Syllabus 4
Module 5 - Database
Using Microsoft® Access XP
Release ECDL46v1
Module 5 Database ECDL
Published by
Aims
To demonstrate the ability to use a database application on a personal
computer.
To understand and accomplish basic operations associated with the Access XP
database.
Objectives
After completing the guide the user will be able to:
Format a Table
Query a Table
Create Forms
Create Reports
Assessment of Knowledge
At the end of this guide is a section called the Record of Achievement Matrix.
Before the guide is started it is recommended that the user completes the
matrix to measure the level of current knowledge.
Tick boxes are provided for each feature. 1 is for no knowledge, 2 some
knowledge and 3 is for competent.
After working through a section, complete the matrix for that section and only
when competent in all areas move on to the next section.
Contents
SECTION 1 DATABASES......................................................................................................7
1 - DATABASE PRINCIPLES......................................................................................................8
2 - STARTING ACCESS.............................................................................................................9
3 - MENUS AND TOOLBARS...................................................................................................10
4 - HELP.................................................................................................................................11
5 - OPENING AN EXISTING DATABASE..................................................................................13
6 - THE DATABASE WINDOW................................................................................................15
7 - CLOSING TABLES, DATABASES AND ACCESS..................................................................16
8 - REVISION..........................................................................................................................17
9 - REVISION..........................................................................................................................18
SECTION 2 TABLES............................................................................................................19
10 - MOVING USING THE MOUSE..........................................................................................20
11 - MOVING USING THE KEYBOARD...................................................................................22
12 - CREATING A NEW DATABASE: DESIGNING AND PLANNING..........................................24
13 - CREATING A TABLE STRUCTURE...................................................................................25
14 - FORMAT FIELD PROPERTY.............................................................................................28
15 - ENTERING DATA IN A TABLE.........................................................................................30
16 - DEFINING A PRIMARY KEY............................................................................................31
17 - INDEXES.........................................................................................................................32
18 - EDITING FIELD PROPERTIES...........................................................................................35
19 - VALIDATION RULES/TEXT.............................................................................................37
20 - PREVIEWING AND PRINTING A TABLE...........................................................................40
21 - PRINTING FROM A TABLE..............................................................................................42
22 - ADDING A NEW FIELD TO AN EXISTING TABLE............................................................44
23 - DELETING A TABLE........................................................................................................45
24 - REVISION........................................................................................................................46
25 - REVISION........................................................................................................................47
26 - REVISION........................................................................................................................48
SECTION 4 EDITING..........................................................................................................63
35 - CHANGING COLUMN WIDTHS........................................................................................64
36 - MOVING COLUMNS........................................................................................................65
37 - FINDING SPECIFIC TEXT.................................................................................................66
38 - USING WILDCARDS........................................................................................................67
39 - EDITING DATA...............................................................................................................69
40 - UNDO.............................................................................................................................70
41 - FURTHER EDITING..........................................................................................................71
42 - ADDING/DELETING RECORDS........................................................................................72
43 - EDITING SHORTCUTS......................................................................................................73
44 - REVISION........................................................................................................................74
45 - REVISION........................................................................................................................75
46 - REVISION........................................................................................................................76
SECTION 6 QUERIES..........................................................................................................85
54 - QUERYING A TABLE.......................................................................................................86
55 - SORTING AND SAVING QUERY RESULTS.......................................................................89
56 - PRINTING QUERY RESULTS............................................................................................91
57 - QUERYING RELATED TABLES........................................................................................92
58 - EDITING QUERIES...........................................................................................................94
59 - RANGES OF VALUES.......................................................................................................95
60 - NON-MATCHES..............................................................................................................96
61 - AND QUERIES.................................................................................................................97
62 - OR QUERIES...................................................................................................................99
63 - DELETING A QUERY.....................................................................................................100
64 - REVISION......................................................................................................................101
65 - REVISION......................................................................................................................102
SECTION 7 FORMS...........................................................................................................103
66 - FORMS..........................................................................................................................104
67 - AUTOFORM..................................................................................................................105
68 - FORM WIZARD.............................................................................................................107
69 - DESIGNING A FORM.....................................................................................................109
70 - EDITING FORM DESIGN................................................................................................111
71 - SORTING AND EDITING DATA......................................................................................112
72 - FILTERING IN A FORM..................................................................................................114
73 - PRINTING FROM A FORM..............................................................................................115
74 - DELETING A FORM.......................................................................................................116
75 - REVISION......................................................................................................................117
76 - REVISION......................................................................................................................118
SECTION 8 REPORTS.......................................................................................................119
77 - AUTOREPORT...............................................................................................................120
78 - GROUPED REPORT: WIZARD........................................................................................121
79 - MODIFYING A REPORT.................................................................................................124
80 - OTHER CALCULATIONS IN REPORTS............................................................................126
81 - PRINTING FROM A REPORT...........................................................................................127
82 - DELETING A REPORT....................................................................................................130
83 - REVISION......................................................................................................................131
84 - REVISION......................................................................................................................132
ANSWERS............................................................................................................................134
GLOSSARY..........................................................................................................................136
INDEX...................................................................................................................................137
Section 1
Databases
Start Access
Exit Access
Manoeuvres
1. Starting your computer will automatically show the Windows desktop.
At the right of the screen is an area called the Task Pane, which provides
options for performing some common tasks. It appears and changes depending
on the task currently being performed. On starting Access, the first Task Pane
deals with opening new databases or existing files. The Task Pane may not
appear at this stage if it has been switched off (see next manoeuvre).
4. At the bottom of the Task Pane is a Show at Startup box. Click in the
box to remove the check. Now the pane would not appear when Access
starts. Click again to check the box and request that the Task Pane does
appear.
5. To hide the Task Pane temporarily, select View | Toolbar | Task Pane or
click the Close button at the right of the pane title bar.
All four areas of the screen, the Menu Bar, Toolbar, Task Pane and Status
Bar, change according to the current task.
6. An Office Assistant may also be visible. Click the Close button, , to
remove it from the screen.
Manoeuvres
1. Move the mouse pointer to the menu option File and
click once with the left mouse button. A short list will
appear as a drop down menu with Chevrons at the
bottom. This list shows the actions that can be
carried out. After a few seconds the list expands to
show all the items. (Double clicking on a menu
displays the full list immediately).
Menu options displayed in a pale font are called ghosted
and are not available to be selected at present.
2. From the new list, select Open. The Open dialog box
is displayed.
Any menu option followed by … leads to a dialog box
which requires more information to be supplied.
3. Click Cancel to remove the dialog box.
5. Move the mouse pointer over the New button in the toolbar. Leave the
Manoeuvres
1. Open the Help menu and select Microsoft Access Help.
If the Office Assistant appears when this selection is made, close it by clicking
the Options button on the yellow dialog box, select the Options tab and
remove the checkmark on Use the Office Assistant to disable it. Click OK.
Select Help | Microsoft Access Help again.
2. Click the Contents tab if not already selected and if the Help window
does not fill the screen, click the Maximize button, .
3. Notice how the screen splits to show the help area in two sections. At the
left are the Contents, Answer Wizard and Index tabs, where all Access
help topics are available. At the right is the display area, which contains
the actual help requested. This area also contains topic headings (blue
text) which can be expanded to give further help text.
6. Move the mouse over any of the blue topic lines until it becomes and
click to expand the help under that heading.
The Show All hyperlink at the top right of the panel will expand the text for all
topics.
7. Read the help, then select the Answer Wizard tab on the left side of the
help screen. In the area provided, type How do I print? and click
Search.
8. Print a database object is selected and the help text is available. Click
some of the headings to expand the text and see more information.
9. Select the Index tab. This tab contains an alphabetical list of help topics.
When a key word is entered, a list of matches is retrieved.
10. Enter filter in the Type keywords area, then click Search. The Choose
a topic box displays the search results and shows the number of help
topics found.
11. Select Apply a filter, if not already selected and from the right side of the
screen click some of the topics to expand them. Read the help then click
the Back button, , at the top of the help window to move back one
page.
12. Click the Close button, , at the top of the help window to close Help.
13. The Answer Wizard function is accessible from the main screen using
the Ask a question box at the right of the Menu Bar. Enter Create a
form in the box and press <Enter>. Select Create a form from the drop
down list to display the Help screen for this topic.
14. Read the Help text and close the Help window.
Manoeuvres
1. Select File | Open or click the Open button, . The Open dialog box is
displayed.
2. In the Look in box the default location is My Documents. Double click on
the Ecdl folder, then the 5 Databases folder. A list of databases in the
folder is now visible.
If the data has been stored elsewhere, display that location in the Look in box.
3. Click on the file name Country and then click Open. The Country
Database Window is now visible.
Passwords are case sensitive and must be entered in the dialog box exactly as
set. None of the databases in this guide has a password, but be aware of their
use.
Manoeuvres
1. Using the Country database, click Reports under Objects, to see if this
database has any reports defined. There are none, just two options to
create new reports.
2. Select Tables, to see a list of any tables in this database. There are two,
called Country and Regions.
Objects Bar
List of Available
Objects
3. Click on Country and then click the Open button, . This will open
the Country table. Maximise the window if necessary by clicking .
4. Click View and then Toolbars. A menu opens showing the different
toolbars that can be displayed.
5. Try selecting and then deselecting some options from this menu. Leave
the menu with the Table Datasheet and Formatting (Datasheet) toolbars
selected.
Manoeuvres
1. Select File | Close to remove the current table from the screen.
2. The table is closed and the Database Window is left on the screen.
1. Start Access.
8. Now open a table within the database and then close it without making
any changes.
9. Close the database.
10. Use the Index from Help Topics to find information About creating a
table.
11. Close Help.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
6. Click on the Answer Wizard and search using the word views.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 2
Tables
Manoeuvres
1. Start Access. From the New File Task Pane, select the Country
database from the list or select More files, and select Country from the
location used earlier.
2. Open the Country table and maximise it.
The current view is known as the Datasheet View. This view shows all the
information that is contained in the table.
3. The table is arranged in rows and columns. Each row (Record), contains
data about a specific country. The Country Field is the first column,
listing all the countries in the database.
4. Move the mouse pointer over the middle of the Region field of Brazil
(South America). The mouse pointer should be a . Click the mouse.
5. There will now be a flashing cursor within the field. Using the mouse, click
and drag part of the field contents. The letters will be highlighted when
selected, ready to be edited if necessary.
6. Click the Previous Record button as shown, to move up a record.
8. Record 6 is shown. Click the Last Record button to move to the bottom of
the table.
9. Record 47 is shown. Click the First Record button to move to the top of
the table.
10. Click on the Right arrow in the horizontal scroll bar to scroll right by one
column (the first column displayed is Region).
11. Click on the Left arrow to view the first column again.
12. Move the mouse pointer to the left edge of the Capital field of Australia.
The mouse pointer should change to (this may take some practise).
When two keys are mentioned such as Ctrl and End, the first key (Ctrl) should
be held down while the other key (End) is pressed and released.
Using the keys mentioned moves the cursor around the table by one whole
record or field. To display the flashing cursor and then move within the field
itself, it is necessary to press <F2> or click with the mouse in the middle of the
field contents. Movement within a field is dealt with later.
3. Keep pressing to move right to the last field, Language. Press again
and the cursor moves to the first field on the next record.
4. Press the <Page Down> key to move down by one screen.
7. Press <F2>. The flashing cursor is now visible. The content of the cell
could now be changed. Press <F2> again to select the field.
8. Press <F5>. The record number becomes highlighted and the Status Bar
shows Enter New Value.
9. Type in 34 and press <Enter>. The Country field for the 34th record
becomes highlighted – Norway.
10. Click on the Region field for Norway and press <F5>.
11. Enter 21 as the New Value. Press <Enter>. The Region field for the 21st
record becomes highlighted – Middle East.
12. Practise moving about the table using the keyboard.
13. Close the table and then the database without saving any changes, if
prompted.
A common way of moving about in a table is to use the keys for moving from
one record or field to the next and to use the mouse for moving from one area
of the table to another.
Manoeuvres
1. Select File | New, or click the New button, .
8. The new database window is now visible. Leave it on the screen for the
next Driving Lesson.
Manoeuvres
1. With the Pets Database Window visible from the previous Driving
Lesson, ensure the Tables is selected and click .
2. From the New Table dialog box, choose Design View, then OK. The new
database design window is now visible.
Design View is the view that allows the structure of the table to be defined or
amended. Datasheet View allows the actual data to be seen and maintained.
3. This is where the Field Names are determined and how the data in that
field will be displayed – Data Type. The cursor should be in the first row
in the first column, under Field Name. In this position, type Animal. Press
<Tab> to move to the next column.
4. Some new information appears at the bottom left of the screen and the
word Text appears in the Data Type column. Press <Tab> to select the
default value of Text.
5. The cursor is now in the Description column, this column is optional.
Enter the text Type of animal into this column and then press <Tab>.
6. The cursor is now in the next row down, in the Field Name column. Enter
the words Date Sold and press <Tab>.
7. In the Data Type column, click on the drop down list button beside the
word Text. A list of all possible data types is shown.
8. Use the mouse to select the type Date/Time, then press <Tab>.
9. In the Description column enter Date animal was sold then press
<Tab>.
10. In the next Field Name, type Price <Tab> and in Data Type select
Currency <Tab>. The description is Price of animal. Press <Tab>.
13. The table must be given a name and saved. Click the Save button, .
14. Enter the Table Name as Pet Details, then click OK.
15. A message appears regarding Primary Keys. These are dealt with at a
later stage. For now, click No to save the table without a primary key.
16. Click on the drop down arrow next to the View button.
17. There are four options available. The Design View is open now. Click on
Datasheet View. The table is ready to accept data. This will be done at
a later stage.
18. Switch back to Design View for the next Driving Lesson.
Manoeuvres
1. The Design View of the Pet Details table should be open from the
previous Driving Lesson, if not, open it.
2. Place the cursor in the Field Name column for the Animal row. The Field
Properties will appear in the bottom left area of the window.
3. Click in the Field Size property from the General tab. Helpful information
is given in blue on the right.
4. Delete the existing value by pressing <Backspace> twice. Type in 20.
This means that this field will only allow 20 characters to be entered into it.
5. Click in the Date Sold field. The Field Properties are different for this
type of field.
7. The format of the date is shown in the drop down list. No matter how the
date is entered, i.e. 1/2/2 or 1 Feb 2002, it will be displayed as 01-Feb-02.
8. The Price field requires no changes. Click on the Number Sold field.
Use the Field Size drop down list to change the size from Long Integer
to Integer.
9. Notice that Access has automatically defined this field as Indexed. Cancel
this by clicking the Indexed property and then use the drop down list to
change the setting to No.
10. Save the changes to the table by clicking and return to Datasheet
View.
Manoeuvres
1. The Pet Details table should be open from the previous Driving Lesson.
2. The empty table is visible. The field names are as entered in a previous
Driving Lesson and the Description for the currently selected field now
appears in the Status Bar in the bottom left corner. The two numerical
fields may have zeros in them by default.
3. In the Animal column, type the word Dog.
5. Enter the date it was sold as 24/2/02 <Enter>, the price as 29.95
<Enter>, (do not enter any pound signs - this will be formatted
automatically) and the number sold as 1 <Enter>. The cursor will now be
in a position (under Dog) to enter the next line of data.
6. Type the following data, exactly as displayed, into the table, remembering
to press <Enter> after each entry. Note that no matter how the data is
entered it will be displayed as entered in the Field Property.
Animal Date Sold Price Number Sold
Toad 25/3/02 1.5 6
Cat 9/4/02 17.95 2
Goldfish 1 May 02 2.25 11
Snail 22/6/02 1.1 34
7. Select File | Close to close the table and return to the Database
Window.
The data that was entered into the table is saved automatically.
8. Select File | Close to remove the Pets database from the screen.
Manoeuvres
1. Open the database Daley.
2. At the database window, click on the table Vehicles and then click the
Design button to open the table in Design View.
3. The field name Reg No should be highlighted. If not, click on it.
4. Click the Primary Key button, , on the toolbar to make this field the
Primary Key.
5. Click the Datasheet View button. The following dialog box appears.
6. Click Yes to save the table. The table will open with the records sorted in
alphabetical order of Reg No.
7. Close the table.
Manoeuvres
1. Open the database Country and the Regions table in Design View.
4. Return to Design View and click the Indexes button, , on the toolbar
to open the Indexes dialog box.
The first index, created from the Region field property box, is shown in the
Indexes dialog box.
5. Click in the Field
Name box of the
second row. Click the
drop down arrow and
select Country from
the list. The Sort
Order will default to
Ascending. Leave
the second row Index
Name box empty.
9. Position the mouse pointer on the Selector Bar, pointing to the row of the
dialog box containing the Index name Region.
10. Click and drag downwards to select the first and second rows.
Selector
Bar
11. Press <Delete> to remove the entries from the Indexes dialog box.
12. Close the dialog box, click the Datasheet View button and click Yes to
save the table.
13. The table will open, with the data in its original order.
14. Return to Design View and click in the Country field.
20. Click OK. Close the table. The dialog box appears again. Click OK.
21. This time a warning that this duplicate entry cannot be saved will appear.
Manoeuvres
1. Open the Staff database. Open the Staff table in Design View.
2. Click in the Surname field. It has a Field Size of 50 - the default setting.
Not many people have such a long Surname, so this may be altered.
3. Click in the Field Size property, delete the existing number and type in 20
– a more appropriate size.
4. Similarly, change the size of the Title field to 5, the First Name field to 15
and the Position field to 20.
5. Click in the Date of Employment field. Drop down the Format options
available and select Short Date. Do the same for the Date of Birth field.
Remember, regardless of how the date is now entered it will appear in the
table in this format.
6. Click in the Salary field. Drop down the Format list and select Currency
(note also that there is a Euro option). Decimal places are set to Auto.
For currency Access assumes 2 decimal places.
8. There are several options that may not be easily understood. Press <F1>
to display the Help for number selection. Read about the options before
closing Help.
9. Save the table. Because the size of some fields has been reduced, a
warning dialog box appears.
10. Click Yes. No data is lost on this occasion, but be aware for any future
changes, that data could be truncated when fields are resized. Any data
lost in this way cannot be retrieved.
11. Leave the table open for the next Driving Lesson.
Manoeuvres
1. The Staff table should still be open in Design View from the previous
Driving Lesson.
2. Select the Title field and position the cursor in the Validation Rule field
property. Enter the following text:
Mr or Mrs or Miss or Ms
3. This defines the permitted entries for this field. Only these 4 titles will be
allowed. In the Validation Text property, enter:
The title must be one of the following: Mr, Mrs, Miss or Ms.
This defines the message that will appear if any text is entered that does not
match the list defined in the Validation Rule.
5. There are now 3 options. Yes will test the existing data with the new rule.
No will not test the existing data but will apply the validation to all new
records. Cancel will return to the Design View.
If Yes is selected and a record has a field entry which does not match the
Validation Rule, a dialog box will appear giving options to keep the new
settings, revert to the old settings or to stop testing. A selection will need to be
made.
6. Click Yes to apply the rule, and check in Datasheet View that the existing
data fits the rule. All of the existing data should already fit the rule.
7. Start a new record. Enter an Employee No of 1050. In the Title field enter
Dr. Press <Tab>. The following message appears.
8. This is because Dr does not match any of the entries in the Validation
Rule. Click OK.
9. Enter your own title in the Title field (as long as it satisfies the rule). Press
<Tab>. As it is included in the Validation Rule the entry will be allowed.
Fill in the rest of the record with your own details.
10. Switch to Design View. Click in the NI Number field. In the Validation
Rule for this field type in Like “??######?” where ? represents a letter
and # represents a number.
Manoeuvres
1. Open the Pets database and the Pet Details table.
2. Click the Print Preview button to preview the table, as it will appear
when printed.
3. Positioning the mouse over the page changes it to . Click once in the
page to zoom in (or click the Zoom button, , on the toolbar).
4. The mouse pointer now changes to . Click in the page to zoom out (or
click the Zoom button, ).
5. Select View | Zoom from the menu. Select the different zoom levels to
view the table. The current view is shown.
6. Select 200%.
7. From the Standard Toolbar click on the drop down menu of the Zoom
box to choose zoom levels. Select Fit to adjust the preview to fit the whole
page on the screen.
12. Use File | Page Setup to change the Orientation back to Portrait.
14. Close the Pet Details table without saving the changes.
15. Close the Pets database.
Manoeuvres
1. Open the Country database and table.
4. Note the way the table is split over the pages. Select File | Page Setup,
and change the orientation to Landscape from the Page tab. The manner
in which the table is divided has changed.
5. Select File | Print. The Print dialog box appears.
8. In the Country table, move the cursor to the left of the table into the
Selector Bar, until it becomes .
9. Click and drag down all the countries beginning with A. They will now be
highlighted.
10. Select File | Print. From the Print Range area click Selected Records.
Manoeuvres
1. Open the Pet Details table from the Pets database. It has been decided
that a profit calculation will need to be done later. The buying price of
each animal needs to be entered.
2. Switch to Design view. Click in front of the word Price and edit it to
Selling Price.
3. Click on the Date Sold field. The new field is to be entered above this
one.
4. Click the Insert Rows button . The cursor is now flashing in the Field
Name of the new row.
5. Type in Buying Price, change the data type to Currency and the
description to Wholesale price.
6. Save the changes and switch to Datasheet view.
7. Note the new field names and the empty Buying Price field.
8. Enter the following buying prices (use the down arrow to move to the next
record): Dog: 20, Toad 0.75, Cat 10, Goldfish 1.5, Snail 0.75.
9. Close the table and the database.
Manoeuvres
1. Open the database Mailing.
3. Add a new field Telephone Number before the date of birth field. Make
the data type Text with 15 characters. Add appropriate numbers in
datasheet view.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
2. Create a new table, and add fields as below with appropriate data types.
3. Save the table as Rivers - do not set a Primary Key at this point.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 3
Table Relationships
Delete Relationships
Manoeuvres
1. Open the database Staff. There are two tables in this database that are
linked by Employee No.
5. Note that both of the linked fields are bold, i.e. are Primary keys (click on
a different field in the Location table to see this more clearly). Because
Primary keys are unique in a table, this must represent a One-to-One
relationship, i.e. one record in the Location table is related to only one
record in the House details table.
If Referential Integrity were applied to this relationship (see Driving Lesson 30)
there would be a 1 at either end of the linking line indicating One-to-One.
6. Close the Relationships window and open the Location table. Notice
that tables in a relationship have an expand button next to each record.
7. Click on the expand button next to record 6. The related data is shown.
This is called a Subdatasheet. Note there is only one related record.
8. Click on the minus sign (collapse button) to close the related table, then
close the table and the database.
9. Open the Staff database and the Staff table. Remember the relationship
between the Staff and Courses tables is One-to-Many.
10. This time click on the expand button next to record 6 – Anthony Myers.
This employee has taken two courses as shown.
11. View other related records before closing the table and the database.
Manoeuvres
1. Open the database Daley.
Alternatively right click on the Relationship window and select Show Table
from the shortcut menu.
4. With the Tables tab selected, click on Vehicles to highlight it, then click
to place that table in the Relationships window.
7. Click and drag the table edges to resize the table boxes to be able to see
all of their fields. Notice the Primary Keys for each table are in bold.
9. Drag the Reg No field, from the Vehicles table, over the Reg No field in
the Repairs table. Release the mouse when in position.
10. In the Edit Relationships dialog box, note the relationship type is One-
To-Many.
The relationship is One-To-Many. This means that one record from Vehicles
can have many related records in Repairs, i.e. one car may have many repair
jobs.
13. To delete this relationship, click on the joining line and press <Delete>. A
confirmation dialog box appears.
Manoeuvres
1. Using the Daley database, create a table in Design view with two fields,
Job No and Charge.
2. The Job No field will have a data type of Number and the Charge field
will be Currency.
3. Make the Job No field the Primary Key.
15. At the moment there is no data in the Charge field. Add a charge of £250
for this repair.
16. Try adding another charge for this repair. Remember there is a One-To-
One relationship in force, so only one charge should be allowed. A
warning dialog box is displayed as below.
17. Click OK once you have read it. The only way to get rid of this useless
information is to use the Undo button . Click on it now.
18. The record is deleted and the subdatasheets can be closed.
19. Open each subdatasheet in turn and add suitable Charges for all
Repairs, but make no charge for Job No 17.
20. Close the table but leave the database open.
Manoeuvres
1. Make sure the Daley Database Window is still open.
4. In the Edit Relationship dialog box, check the box for Enforce
Referential Integrity and click .
Enforcing Referential Integrity will change the relationship line to show the type
of relationship, in this case, one to many.
5. Repeat the process for the relationship between Repairs and Cost.
Manoeuvres
1. Open the Vehicles table in Datasheet View.
2. Click in the record R654 TFG and click the Delete Record button, .
The record may not be deleted, as there are records in the Repairs table
that refer back to this record, i.e. repairs for vehicle R654 TFG.
5. Click the Add New Record button, and enter the following
information:
David E666 EEE 5/1/2
6. Press <Enter> after the last entry. As there is no registration number for
this job in the Vehicles table, a new job record cannot be created.
7. Click OK. Delete the information just entered using Undo. Close the table
and return to the database window.
14. The dialog box is a warning that there is a record in other tables for this
vehicle and they too will be deleted. Read the dialog box then select Yes.
15. Change the registration E666 RPR to E666 RPP.
16. Close the table and open the Repairs table in Datasheet View. All jobs
for the Quattro are removed (Job 11) and the registration number change
has been reflected in the Repairs table (Job 13).
17. Close the table and the database.
2. Open the Current Status table to view the information available to the
Agent. Close the table.
3. Open the Relationships window and establish a relationship between the
Current Status table and Past Clubs using the Ref Code.
4. Enforce Referential Integrity and Cascade all information.
6. Use the subdatasheets to view the related data from the Past Clubs
table. Do not make any changes.
7. Close the table and the database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
1. Open the Cia database and view the tables that are available. This is a
typical database used by a retailer to keep track of customers and
suppliers.
2. Open the Relationships window and establish the following One-to-
Many relationships, enforcing referential integrity and cascading all
information.
Customer Details table – Orders table by Customer Ref
Orders table – Order Details table by Order Ref
Order Details table – Products table by Product Ref
Products table – Suppliers table by Supplier Ref
3. Close the Relationships window and open the Customer details table.
View the data and the related data through the several layers of
subdatasheets.
4. Close the table.
5. Open the Suppliers table and use subdatasheets to see which products
they supply.
6. Close the Suppliers table and open the Relationships window again.
Delete the relationship between Products and Suppliers.
7. Open the Suppliers table, there is now no relationship between the
suppliers and what they supply.
8. Close the table and then re-establish the relationship.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
2. View the relationship between the tables House details and Location
tables. It should be One-to-One by House Ref. Close the
Relationships window.
3. Open the Location table and view the subdatasheet for the 6 th record – 1
Poplar Place. Close the table.
4. Open the House details table and view the subdatasheet for the 6 th
record. The data is the same as before, although the format is changed.
One-to-one related tables can be viewed either way as neither is the
primary table.
5. Close the table and the database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 4
Editing
Move Columns
Find Text
Use Undo
Manoeuvres
1. Open the Houses database and the table Houses within it.
2. Click on any record within the Town field. Select Format | Column Width
to display the Column Width dialog box.
3. Enter 10 in the Column Width box. Click OK. The column is now
narrower. The data is still there, it just cannot be fully seen.
4. Move the mouse pointer into the column border between the Address
and the Type field headings. The pointer will change to a .
5. Click and drag the column border to the left, until the Address field is
about half its present width, then release the mouse button.
6. Position the mouse pointer on the column border between the Address
and the Type fields again.
7. Double click the mouse button. The column will automatically adjust to fit
the widest entry. Experiment. Try changing the widths of other columns.
8. Select the first 4 columns by clicking and dragging the first four Field
Headings and then select Format | Column Width.
9. Enter 15 into the Column Width box then click OK. All 4 columns are now
the same size.
10. Select all the columns in the table. Position the mouse over any column
border and double click. All columns are resized to the Best Fit.
11. Leave the table on screen for the next exercise.
If the table were closed now, the Save dialog box would be shown, as design
changes have been made.
Manoeuvres
1. The Houses database and the table Houses should still be open. Click
anywhere in the table data to remove any selections.
2. Move the pointer to the Address column label. Click with the mouse on
the label to highlight the entire column and release the mouse button.
3. Now click and drag the mouse to the right. The cursor changes indicating
a column move and a black line in the table indicates where the column is
to be re-positioned. Position Address to the right of the Price column.
5. Click on the Type column label. Hold down the <Shift> key and click on
the Price label to highlight both. Move both columns at the same time to
the right of Address.
6. Close the table without saving, resetting the columns.
7. From the same database, open the House details table in Design View.
The Occupied field is to be moved to the extreme right of the table, i.e. to
the bottom of the field name list.
8. Click in the Selector Bar to select the entire Occupied row.
9. Keeping the cursor at the left edge, click and drag the field to the bottom
of the list.
10. Save the changes, as this is a design change and switch to Datasheet
View. The Occupied column will be at the extreme right of the table.
11. Close the table and the database.
Manoeuvres
1. Open the Staff database. Open the table Staff and maximise, if
necessary.
2. Click in the First Name field of the first record then click the Find button,
, on the toolbar.
3. In the Find What field type Anthony.
4. Click the Find Next button. The message Search succeeded appears in
the Status Bar and current record is now Record 6.
If the Find and Replace dialog box is obstructing the view of the table, position
the mouse pointer over the Title Bar and click and drag to a new position.
5. Click Find Next to jump to the next occurrence of Anthony. The current
record is now Record 10.
6. Select Find Next again. The end of search message appears.
7. Select OK and then click the Cancel button to close the Find and
Replace dialog box.
8. In the Date of Employment field search for 01/12/1986. (If unsure of how
the field is formatted, then uncheck Search Fields as Formatted, and the
find entry could be any date format, e.g. 1/12/86)
9. In the Employee No field search for 801.
Manoeuvres
1. Open the database Country and then open the Country table.
2. Move the cursor into the first record of the Capital field and click the Find
button.
3. The text to search for will be Tok?o, not knowing whether the spelling is
Tokio or Tokyo. In the Find What box enter Tok?o.
4. Click the Find Next button. When the message Search succeeded
appears in the Status Bar, select Cancel to close the Find and Replace
dialog box and see the position of the cursor. Record 23 and the field
containing Tokyo will be highlighted.
5. Place the cursor in the Currency field and select the Find button.
6. In the Find What box, enter D*r. This search will find all currencies
beginning with a D and ending in an r, with any text in between.
7. Use the Find Next button to jump through the records as necessary.
Select OK at the end of the search and Cancel to discontinue searching.
There are 7 matches.
8. Search the whole table for any word or multiple words that begins with a
G and has an E in it. To search the whole table rather than a specific
column, click the drop down arrow in the Look In box and select
Country : Table from the list. Use g*e* in the Find What box.
9. Find all the matches – there should be matches for Germany, German(3),
Greece and Greek, 6 in total.
10. Find which countries are in a Region that includes the word America.
Click in the Region column, select Region in the Look In box, enter
america in the Find What box and select Any Part of Field in the Match
box.
11. Find the matches then close the Find and Replace box.
12. Position the cursor in the Population field. Click the Find button.
13. Change the value in Match back to Whole Field. Type 4.# in Find What
to find which countries have a population between 4 and 5 million.
14. Close the Find and Replace box.
15. Leave the table open for the next Driving Lesson.
Manoeuvres
1. The Country table should still be open. If not, open it.
3. Click once with the mouse on the Population field. The cursor will
appear.
4. Use the left and right cursor keys to move about in the data.
5. Move to the end of the field, i.e. the cursor should be to the right of the 6.
6. Press the <Backspace> key to remove the 6.
7. Type in 7. Notice that the Editing Record indicator appears at the left of
the row. The population has now been changed to 7.7.
8. In a similar way, change the population of the UK to 58.
The Undo command refers to the last action that was carried out, so it may
read Undo | Typing, Undo | Current Field/Record or other commands.
Manoeuvres
1. Move the cursor into the first field of the Afghanistan record and press
<Tab> to move to the Region field. Overtype Asia with Europe.
2. Press <Tab> to move to the Capital field. Overtype Kabul with Paris.
Press <Enter>.
3. To erase these mistakes, select Edit | Undo Current Field/Record.
(Afghanistan is still the current record).
4. Paris should now have changed back to Kabul and Europe to Asia.
7. Move the pointer over the Undo button, . A ToolTip will be displayed
- Undo Saved Record. Click on the button and the Afghanistan record
will be restored.
The menu command Edit | Undo Saved Record may also be used.
Remember changes can only be made to the last record edited. In the example
above, if any changes had been made to the Denmark record, the changes to
the Afghanistan record could not then be undone.
8. Close the table and database.
Manoeuvres
1. Open the Staff database and Courses table.
Manoeuvres
1. Open the Staff table and click the New Record button, , either from
the Toolbar or from the Navigation buttons at the bottom of the screen to
create a new record (or select Insert | New Record).
2. Type in the following information, pressing <Tab> to move into the next
field.
521
Ms
Singh
Ghita
Sales Manager
21/6/99
WF567890G
30000
22/7/65
3. Use your imagination to add another new record for a fictitious person.
Remember the validation rules that were set up earlier.
4. Ghita Singh’s record is to be deleted. Position the cursor within her
record. Press the Delete Record button, , (or choose Edit | Delete
Record from the menus).
Manoeuvres
1. Staff should still be open from the previous exercise. Add the following
new employee.
802
Mr
Miles
Peter
Creative Accountant
2. Move to the Date of Employment field and use <Ctrl ;> to insert today’s
date.
3. Enter WL562984T the NI Number.
4. His salary is the same as the previous record, use the Ditto function,
<Ctrl ’> (apostrophe) to add the appropriate information.
5. Enter 23/2/75 in the Date of Birth field.
6. Add the following record, Atlantis, Europe, Metropolis, 46, 23, 2, Dollar,
English.
8. Use Find to locate all the countries within the region Middle East. How
many are there?
9. Using Wildcards, find all capital cities beginning with the letter B. How
many are there?
10. Delete the record for Atlantis.
11. Close the table, select No at the save prompt.
12. Close the database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
4. 22 Chapel Road has come on the market. Add a new record – use a
keyboard shortcut to copy the details above the new record, remembering
to change the address from 21 to 22.
10. 44 Daffodil Terrace has been for sale for some time, so the price is being
reduced. Change it to £27,000.
11. The property at 15 Low Row has been entered as a First Floor Flat
when in fact it is on the second floor. Make the change.
12. Close the table, but do not save the changes.
13. Open the table again to make sure of the position of the Type field.
14. Close the table and the database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
3. Move the Telephone column next to the Surname for easy use.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 5
Sorting and Filtering
Sort Data
Use Filters
The table is only sorted temporarily. When it is closed and then opened again,
the sort is lost. To retain the sort, save the table before closing.
Manoeuvres
1. Open the database Staff and the Staff table.
3. Click the Sort Ascending button, . The table will be instantly sorted
into Surname order, Ascending.
4. With the cursor still in the Surname field, click the Sort Descending
button, . Notice how the table is now sorted by surname, in
descending order.
5. Sort the table by Salary in ascending order.
6. Sort the table in descending order by the Date of Employment to see the
newest starters first.
7. Close the table without saving the changes.
The principles of sorting records apply in the same way in Queries and Forms,
see later exercises.
Manoeuvres
Filter By Selection
1. Open the database and table Country.
Filter By Form
6. Click the Filter By Form button, . In the Region field, use the drop
down list to select a value of Asia, or enter it by typing.
7. Click the Apply Filter button, . All countries in Asia should now be
selected. Remove the filter.
8. Close the table and database, without saving the changes.
10. Click the Filter by Form button . This filter will use two criteria.
11. In the Town field, drop down the list and select Cockermouth. In the
Type field, drop down the list and select Terraced House.
12. Apply the filter. There are 4 matching records.
13. Close the table without saving (filter was not removed first), but leave the
database open.
Manoeuvres
1. Open table Houses.
2. To show all the Towns except Cockermouth, position the cursor within
Cockermouth in the Town field.
3. From the menu, select Records | Filter | Filter Excluding Selection.
Scroll through the records.
4. Notice how all the records with Cockermouth as their Town have been
excluded from view. The status bar shows 1 of 25 (Filtered).
5. Select Records | Remove Filter/Sort or click the Remove Filter button,
to view all records.
6. Select the word House from the Type column.
8. Observe that all the properties whose type was any kind of House have
now been filtered out (leaving 12 records).
9. Remove the filter.
10. Leave the table open for the next Driving Lesson.
Manoeuvres
1. Use the Houses table, which should be open from the previous Driving
Lesson.
2. Position the mouse over any data in the Town column and click with the
right mouse button. A shortcut menu appears:
3. Click in the Filter For box and type Maryport. Press <Enter>.
4. Notice how the records have now been filtered to show only the properties
in Maryport.
5. Position the mouse back over the Town column, click with the right
mouse button, then Remove Filter/Sort.
6. Move to the Type field. Display the shortcut menu as above.
7. In the Filter For box type in *bungalow*. This will give all records that
include bungalow in their type. There are 5 records.
8. Practise filtering and sorting using the right mouse button.
9. Remove any filter and leave the table open for the next Driving Lesson.
1. Open the database and table Houses, if it is not already open. Remember
to remove the filters between steps.
2. Find all properties in the Town of Whitehaven.
5. Find all the properties whose Type includes Flat. Remember to use the
wildcards!
6. Close the table and database without saving the changes.
10. Sort the countries into alphabetical order of their capital city. Which
country is first?
11. Remove from view all the records that are in Europe? How many records
are left?
12. Sort this answer by Density – highest first. Which is the most densely
populated country outside Europe?
13. Close the table and the database without saving.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
7. Use Filter by Selection to find how many orders have not yet been paid.
Do not be concerned if the No changes to a zero, this is how Access
recognises Yes/No fields.
8. Remember to remove the filter.
9. Sort the table into Date Paid order. This also has the effect of collecting
together all of the unpaid invoices.
10. Close the table but do not save it. Close the database.
11. Open the database Daley and the table Vehicles.
12. Use Filter by Form to find out if there are any Black cars with an Engine
Capacity of 3500.
13. Remove the filter and sort the data by Engine Capacity ascending. It
does not appear to have sorted in the correct order. Why is this? In
Design View, try changing the Field Data Type for the Engine Capacity
to Number rather than Text.
14. Reapply the sort ascending, it should now be correct.
15. Close the table without saving the sorted changes and close the
database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
1. Open the Football Agent database and the Current Status table.
2. Sort the players into order by Date Joined showing the longest serving
first.
3. Now sort them into salary order, highest paid first.
4. Find the record for Barry Boots. Open his subdatasheet and sort the
Date Left field in descending order. Close the subdatasheet.
5. Sort the records in Current Club order to see if there are any players on
the books playing for the same club.
6. Close the table and the database without saving any of he changes - No
to All.
7. Open the Staff database and table.
8. Use a filter to find all staff involved in sales (use *sales* in the criteria).
How many are there? Remember to remove filters after use.
9. Use Filter by Form to find how many men are involved in sales.
10. Use Filter by Selection to find all employees who started work in 1985.
11. How many people are paid £15,000 per annum?
12. Sort by Date of Birth. Who is the oldest member of staff?
13. Close the table and database but do not save any changes.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 6
Queries
Manoeuvres
1. Open the database Mailing.
3. From the dialog box select Design View and click OK.
4. In the Show Table dialog box, with Mailing selected click Add, then
Close.
6. In the first column of the query grid, click on the down arrow button to
display the list of fields. Click on Name.
7. The Show box for Name should be checked
(have a tick in it). If it does not, click on the box
to check it. This query is asking Access to
show only the Name field in the answer.
9. An answer table appears. In this case it only consists of the Name field
because that was the only field placed on to the Query Grid. with the
Show box checked.
10. To switch back to the query design, click the Design View button, .
11. Scroll down the Field List in the top half of the grid until Department is
visible. Click and drag the field Department and release anywhere in the
second column in the query grid. The Field Name Department will be in
the column and the Show box will be checked. Click the Run button to
see the new answer table.
12. Both the Name and Department field should now be visible. Switch back
to the query design, using the Design View button.
13. To clear the query grid completely, select Edit | Clear Grid.
16. This query now asks to see all the fields of any record whose
Organisation field equals FE. The criteria could have been entered as
=FE but the equals sign is not required. Click the Run button to see the
answer table. Scroll through the table to check that all records have FE
(Further Education) in their Organisation field. There are 2 records.
17. Switch back to Design View. Notice the “ ” around the FE criteria.
Access often changes the criteria to its own language to run the query.
18. Click in the Criteria box of the Organisation field and delete the “FE” by
using the <Backspace> or <Delete> keys.
19. Click in the Criteria box of the Computer field. Type in PCW, then Run
the query. The three records containing PCW in their Computer fields
should be visible. This shows the organisations that use PCW computers
(PCW is a very old type of computer). There are 3 records.
20. Switch back to Query Design.
21. Use Edit | Clear Grid to remove the information from the query design.
Double click on Name to place it in the first column of the query grid. It
may be necessary to scroll left to see it. Place Town and Post code in
the second and third columns using the same method. Make sure all
fields have their Show boxes checked.
22. In the Criteria of the Town field, type London. Run the query. It finds
name and postcodes of people living in London. There are 2 records.
23. Select File | Close to close the query. When asked “Do you want to
save ….”, click No.
24. Close the database.
Querying is not case sensitive. Searching for Fred will also find FRED and fred.
Manoeuvres
1. Open the database Houses and click the Queries object.
2. From the Database Window, double click Create query in Design view.
This opens the Query window and the Show table dialog box.
3. Add the Houses table to the query and close the dialog box.
4. Add the following three fields to the query grid by double clicking on them:
Town, Occupied and Price.
5. In the Criteria for Town, enter Cockermouth. Run the query. There are
5 results.
7. In the Sort area for Price, drop down the list and select Ascending.
8. Run the query again and the records are sorted in order of price.
9. Switch back to Design View again and select Edit | Clear Grid.
15. Replace the text Query1 with 2 bedrooms and click OK. The query is
saved and the title is shown in the Title Bar of the Query window.
16. Sort the Town field Ascending leaving all other criteria as they are. Run
the query.
17. Notice that the first sort is on the town, so they are first in ascending
alphabetical order. The second sort is on price in descending order, so
within each town group the price is sorted with the highest number first.
18. Return to Design View and change the Town field sort to Descending.
Run the query to see the towns in reverse alphabetical order.
19. Use either File | Close or the Close button to close the query. At the
dialog box select No to retain the previously saved query.
20. The Database Window now shows the saved query 2 bedrooms.
Double click on it to open it. It is as saved at step 15.
21. Leave the query open for the next Driving Lesson.
Manoeuvres
1. The 2 bedrooms query is open from the previous Driving Lesson. Before
producing a hard copy, click Print Preview to see how it will appear on
the page.
2. Select File | Page Setup, click the Page tab and change the orientation,
i.e. from Portrait to Landscape. Click OK.
3. Zoom in to the page by clicking on it with the magnifier. Note that there is
a header showing the title of the query and the date and a footer showing
the page number.
6. Select File | Print. Note that from the dialog box there are options to print
selected parts of the query result, in exactly the same way as for a table.
There is also an option to print more than one copy.
Manoeuvres
1. Open the database Daley. The relationships between the tables were set
in Driving Lesson 28.
2. Click the Queries object and open a new query in Design View.
3. The Show Table dialog box lists all three tables. Double click on
Vehicles and then on Repairs to add them to the query. Close the Show
Table dialog box.
4. The relationship is shown.
5. From the Vehicles field list select to add the following fields: Reg No,
Model and Manufacturer.
6. From the Repairs field list select to add the following fields: Mechanic
and Date of Repair.
7. Note that the Table name for each field is displayed in the query,
indicating the source of each of the fields.
8. In the Mechanic criteria enter David. This will display only David’s jobs.
Run the query. There are 2 records.
10. Run the query again. The results are the same, except that David’s name
is not shown.
11. To ‘unhide’ the field, return to Design View and replace the tick in the
Show box. Run the query again, the name will be shown.
12. Return to Design View, remove the tick from the Show box in the
Mechanic field and save the query as David.
13. Run the query and Print Preview the query results. David’s name will
appear as the title.
14. Print a copy.
15. Switch back to Design View. Click the Show Table button and add
the Cost table to the query.
16. Double click on the Charge field to add it to the query.
17. Run the query.
18. Now the charge for each of David’s jobs is included.
This is dependent on you having added data in Driving Lesson 29. Because
Cost is now included in the Query, records will only be selected for Jobs where
there is a related cost record. If none of David’s jobs have costs entered then
no records will now be displayed.
19. Close the query without saving but leave the database open.
Manoeuvres
1. The Daley database is open, open the David query.
6. Once the mouse button is released the field is dropped in its new position.
7. Run the query now. It makes more sense to have the Manufacturer’s
name before the Model name.
8. Switch back to Design View. Select the Manufacturer field again. Press
the <Delete> key. The Manufacturer field is no longer displayed.
9. Run the query to check.
10. Close the query without saving but leave the database open.
Manoeuvres
1. Use the database Daley and create a New query using the Vehicles
table.
2. Place the Reg No, Model and Price fields on to the query grid by any
method.
3. To find all the
cars costing
less than
£3000, type
<3000 in the
criteria box of the Price field. Make sure that the Show boxes are
checked.
4. Run the query . The answer table should contain the vehicles costing
less than £3000 and display their Reg No, Model and Price. Click on
Design View to return to the Query Grid.
5. Add the Previous Owners field to the query grid. Look for all cars with
four or more owners, which also cost less than £3000. Type >=4 in the
criteria box. Typing >3 would produce the same result.
6. Run the query. This is a multiple query.
Manoeuvres
1. Open the database Houses and create a New query using the Location
and House details tables.
2. Place the Town and Type from the Location table and Price from the
House details table on to the query grid. Ensure that they have their
Show boxes checked.
3. In the Criteria box for the Town field, type <>Cockermouth to find all the
properties except those in Cockermouth.
4. Run the query. The answer table contains 25 records.
5. Switch to the Query Design. Remove the current query criteria and add
the Address field to the query grid.
6. In the Town Criteria box change the entry to Not Workington and sort
the Town ascending and then Price ascending. Run the query. There
are now 24 results.
7. Save the query as Not Workington.
Access does not select blank fields when searching for non-matches. A record
with no data in the Town field, would not be included in a Not Workington
query.
Manoeuvres
1. Open the database Staff and then open a New query using the Staff
table.
2. Place the fields Surname and Date of Birth on to the grid. Ensure that
both fields have their Show boxes checked.
3. To list all the employees born in the 1960s, type the following information
into the Date of Birth Criteria box:
>=01/01/60 and <=31/12/69
4. Widen the Date of Birth field by clicking and dragging the right border to
the right, till all the data is visible.
5. Run the query. The answer table contains the names of all the people
born in the 1960s (~8 records, depends on the values used on additional
records).
6. Switch back to the query design. Remove the Date of Birth field from the
grid by highlighting and deleting the Field and Criteria information.
7. Place the Salary field on to the query grid.
10. The answer table contains all of the people who earn between £15,000
and £20,000 (6 records).
11. Close the query without saving.
12. Close the database.
Manoeuvres
1. Using the Houses database, place the fields Town and Address on a
new query grid based on the Houses table. Ensure that both Show
boxes are checked.
2. To search for all properties in Maryport Or Aspatria, enter Maryport or
Aspatria in the Criteria box for Town.
3. Run the query. The answer table contains all properties in Maryport or
Aspatria. There are 5. Switch back to the query design.
4. Clear the criteria and place the Bedrooms field on the grid.
5. In the Criteria box of the Bedrooms field enter 3. In the line below, the
or line, enter 4. This will search for three or four bedroom houses.
6. Run the query. The answer table contains eighteen properties, all of
which have either three or four bedrooms.
7. Save the query as 3 or 4 bedrooms and close it.
The Maryport/Aspatria query could have been entered in the same way.
8. Leave the database open.
Manoeuvres
1. The Houses database is open. Display the queries.
3. Select Edit | Delete or press the <Delete> key. A dialog box is displayed.
1. The database Houses is open from the previous Driving Lesson. Start a
New query using the Houses table.
2. In the Field List, select all the fields and place them on the query grid.
5. Switch back to the query design. Clear the grid. Now try the following
questions. The fields to use are shown in brackets after each question.
6. How many properties include a garage in the sale? Place Yes in the
Garage column. (Show Town, Address and Garage).
7. How many properties are for sale? Put For Sale in the Status field. (Show
Town, Address, Price and Status).
8. How many three-bedroom properties are there? (Show Town, Address,
Bedrooms and Price).
9. How many properties are there in Whitehaven? (Show Town, Address
and Price).
10. How many properties cost less than £22,000? (Show Town, Address,
Price).
11. How many properties cost between £40,000 and £50,000? (Show Town,
Address, Price).
12. Use the criteria *list* in the Comment field. What comment does it find,
and what is the Address? (Show Town, Address, Comment).
13. Use <> None in the Offers column, to discover how many houses have
offers placed on them. (Show Town, Address, Offers).
14. Close the query without saving.
15. Close the database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
1. Open the Football Agent database and create a query that will show the
Surname, First name, Current Club and Annual salary of any player
earning more than £100,000 per year. Do not show the actual salary.
2. Move the First name field so that it will be displayed before the Surname.
7. Create a query to show the manufacturer and model of all cars repaired
on 2nd January 2002 and how much was charged for each.
8. Save the query as 2 Jan.
9. Do not show the date in the answer, as it will now be the title of the query
result. Print a copy.
10. Delete this query and close the database.
11. Open the Staff database and create a new query based on the Staff and
Courses tables.
12. Find out how many staff has been on a course after the 1 st April 1995.
Show Title, First name, Surname, Course and Date.
13. Using the same fields, find out how many staff have been on an
introductory course of some kind – use *intro* as the criteria.
14. Find out the only member of staff with a salary of more than £20,000 has
been on an Intermediate course.
15. Close the query without saving and close the database.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 7
Forms
Use AutoForm
Format a Form
Manoeuvres
1. Open the database Staff. Open the Staff table in Datasheet View and
examine the structure of the records and sub data sheets (Course table).
2. Close the table and select Forms in the Object list.
3. Click the form Staff Info Form, then Open. The form is based on both the
Staff and Course tables.
4. Look at the form. This is an example of a fairly complicated form using
graphics, linked tables, formatting, etc. Not all of these features are
covered in this guide.
5. Use the navigation buttons at the bottom of the form to view other records.
Navigation
buttons for sub
form
Navigation
buttons for main
form
6. Use the View button to switch to Design View where the layout of
the form is created or amended. Switch back to Form View.
7. Close the form with File | Close and close the database.
Manoeuvres
1. Open the database Houses. At the Database Window, click on the table
Houses.
3. Use the navigation buttons at the bottom of the form to scroll through the
records.
4. Switch to Design View using the View button. Notice how for each field
there is a label in a grey box, that will be shown in the form and a text box,
in a white area, that will display the data.
5. Switch back to Form View.
6. Select File | Close to close the form, selecting No not to save it.
The drop down list will contain all tables and queries in this database.
9. Click OK and the form appears after a few seconds. Scroll through the
records using the navigation buttons.
10. View the design of this form – it is very similar to the Autoform.
11. Close the form without saving but leave the database open.
Manoeuvres
1. The Houses database should still be open.
3. At the dialog box select Form Wizard and choose to use the Houses
table.
6. Click on each layout to view the sample. Select Columnar and click
Next.
7. View the various options for the style, before settling on SandStone.
9. The final option gives the form its saved name. Click Finish to accept the
suggested name of Houses1 to create and save the form.
10. Scroll through the records and view the design of the form.
11. Close the form and the database.
Manoeuvres
1. Open the database Mailing, click Forms in the Objects list,
and then click New.
2. At the New Form dialog box, select Design View and then click on the
down arrow button next to Choose the table….
3. Click on Mailing then click OK.
4. The Form Design window is now visible. The Toolbox and Field List box
may be anywhere on the screen or even not displayed.
Ruler
Form
Toolbox
Field List
13. Select File | Save As and enter Addresses as the form name. Leave the
form on screen for the next exercise.
Manoeuvres
1. The Addresses form is still visible in the Form Design window. Switch to
Form View the view the data. Switch back to Design View.
2. Select Edit | Select All or press <Ctrl A> to select all fields on the form.
3. Position the mouse over one of the fields. The pointer becomes a hand
. Click and drag all of the selected fields to the centre of the form.
4. From the menu, select View | Form Header/Footer. A new section
appears at the top of the form called Form Header. Whatever is placed in
here will appear at the top of the form.
5. From the toolbox, click on the Label tool, . Click and drag with the
Label pointer, , to create a box in the centre of the Form Header,
about 5cm by 1cm – use the ruler as a guide.
6. The box has an insertion point in it. Type in
CIA Addresses. Click outside the box to
check the appearance of the text. Click on
the box again to display the handles.
7. There are formatting buttons on the Formatting (Form/Report) toolbar
that can be used to change the text in the label box. Any text can be
changed in this way. The formatting will apply to all text in any selected
boxes.
Manoeuvres
1. Switch to Form View of the new Addresses form in the Mailing
database.
Record Navigation
buttons
2. Click the New Record button, , to start a new record. Enter your
Name, Address, Organisation and Department. Notice that the record
has been added at the end, i.e. record 20.
3. Navigation buttons can be used to move through the records. Click the
Previous button, , 3 times to move to record 17, then the Next button,
, to move to record 18.
7. Click in Address (1) field and press the Sort Ascending button . The
first record is now that of Andrews High School.
8. Leaving the cursor in the same field, press the Sort Descending button
. The first record is now Wills school.
9. Sort the records by Towns – ascending. The first town will be Brighton.
14. Type in 6 and press <Enter>. The new record number is 6 and the
reference number is 6, i.e. the original order.
15. The computers for this record have been changed from IBM PC to Apple
Macs. Click in the computer field and delete the entry, just as in a table.
Enter Apple Mac in its place.
16. Goto record 12. This school has closed and so is to be deleted.
17. Press the Delete Record button and a warning dialog box appears.
18. Selection Yes to confirm the deletion. Check that there are now 18
records.
19. Close the form and the database.
Manoeuvres
1. Open the database Country, select the Forms object and open the
Country Form.
2. Go to record 8. Place the cursor in the Currency field. To filter (select)
all records that have dollar as their currency, click the Filter by Selection
button .
3. The record changes to that of Australia, the first in the table with this
criteria. However, notice that the record number indicator now shows 1 of
4 (Filtered) and the status bar shows FLTR.
6. Delete the current criteria. In the Language field enter English and in the
Density field enter >5 (ranges can be used just as in queries).
7. Click the Apply Filter button. There are 5 records. Scroll through them to
establish that the criteria have been met. Remove the filter.
8. Leave the form open for the next Driving Lesson.
Manoeuvres
1. The Country Form should still be open from the previous Driving Lesson.
2. Use File | Page Setup to ensure the page orientation is set to Portrait.
3. Use the Print Preview button to look at the 12 pages. The form properties
have been designed in such a way that several records can be displayed
on a page, but no record is split over two pages.
Pressing the Print button in Print Preview would print out all the pages.
4. Select File | Print to display the Print dialog box.
5. To print only the last page, click on Pages in the Print Range. In the
From and To boxes type in 12.
6. Click OK. Only the last page will be printed. Close Print Preview.
7. Press <F5> and go to record 8. Select File | Print. This time form the
Print Range, select Selected Record(s) and press OK. Only this record
will be printed.
8. Go to the first record and click in the Region field. Filter by Selection
and then Print Preview the result. Only 6 records are on view. Click the
Print button to print only these filtered records.
9. Remove the filter, close the form and close the database.
Manoeuvres
1. Open the database Daley and click the Forms object.
2. There are two forms available, neither is required. Click on Cars but do
not open it.
1. Use the AutoForm button, , to create a new form for the table
Houses from the Houses database.
2. Add a Form Header and enter a title of Current Houses.
3. Format the title text as Arial, 14pt, Bold. If necessary enlarge the Label
box to display the whole title. Reduce the Form Header size to fit the
label.
4. Reduce the size of the Form Footer area until it no longer exists.
6. Filter by selection all the records that include the word House in their
Type field. Print Preview the result.
7. Sort these records into ascending order by Town.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
2. Create a query based on the Country table including the following fields:
Country, Region, Capital, Population and Area.
3. Add criteria for populations over 50 million.
10. Change all of the text in the form to Book Antiqua size 12.
11. Check that all the data is displayed, if not resize the fields using the
handles so that no data is truncated.
12. Sort the records by Area ascending.
13. Add a label in the Form Footer and enter your name.
14. Preview the data. Print out all of the records.
15. Close the database, saving the changes to the form.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide. Only when competent
move on to the next Section.
Section 8
Reports
Manoeuvres
1. Open the database Staff and click the Reports object .
8. To create a report based on a query, click the Reports object and then
click New.
9. Select AutoReport: Tabular and from the drop down list select the
Owners query. Click OK.
10. After previewing the report, save it as Previous Owners and close it.
11. Close the database.
Manoeuvres
1. Open the Houses database. Click the Reports object, then New.
2. At the New dialog box select Report Wizard and from Choose the table
or query… select the Houses table. Click OK.
3. Click on > to place Town, Type, Address, Price and Bedrooms into the
Selected Fields area for the report.
7. Suggestions are given where these calculations can be made (only for
numeric fields). Click in Avg, Min and Max for the Price field.
8. Click OK and then Next. Choose the Stepped Layout and Landscape
Orientation, if these are not already selected.
9. Click Next.
10. Choose the Corporate style, if not already selected and click Next.
11. Finally, name the report Grouped Town.
12. Click Finish to create, save and view the report. Any adjustments to field
sizes and positions that may be required would have to be made in
Design View.
13. The properties are all grouped by Town and appear in Type order within
that town. Summaries are shown for each group.
14. Close the report and close the database.
Manoeuvres
1. Open the Staff database and create a query based on the Staff and the
Courses tables. Include Title, Surname, Firstname from Staff and Date
and Course from Courses.
2. In the Date criteria include only those dates in the 1990’s
>=1/1/90 and <=31/12/99
3. Save the query as Completed Courses and close it.
4. Create a new report using the wizard, based on this new query.
5. Add all of the fields to the report and on the next screen leave the
suggestion for viewing the data as it is.
6. Choose to Group by Surname.
14. Select the label and the field for the Title and First Name (4 boxes) and
move them to the left, up to the right edge of the Surname fields.
15. Select the Date label and field and move them away from the Course
data.
In a report where these areas are not present they can be added by selecting
View | Page Header/Footer and View | Report Header/Footer.
19. Select the title text in the Report Header and change it to 1990 Courses.
20. Click on the lower edge of the Report Footer bar and drag it down to
create a data area about 2cm deep.
21. Create a Label box in this area and add the text Created by and then
your name.
22. Preview the report to see the new features.
23. Save the report and close it.
24. Close the database.
Manoeuvres
1. Open the Houses database and the Grouped Town report.
2. Switch to Design View. The wizard has created a group header (Town
Header) and a group footer (Town Footer). To count the number of
properties in each town, a calculation must be entered in the group footer.
3. Select the text box in the Town Footer that begins Summary for… and
delete it.
4. Increase the size of the footer and from the Toolbox click the Text Box
button . Draw a text box at the left of the Town Footer. This
immediately becomes two boxes, a label and an unbound box. Enter the
following information in the label and the unbound box.
.
If the boxes overlap, move the mouse over the top left corner until it becomes a
pointing hand and click and drag the top box away, , then reposition
each box using the pointing hand.
Any field that contained data for every record could have been counted.
5. Draw another text box below the first and enter the following
. Make the Town Footer deeper, if
necessary.
6. Print Preview the report. Because the calculations were placed in the
Town Footer, each town now shows the number of properties and the
total price of the properties in that town.
7. Save and then close the report, but leave the database open.
Manoeuvres
1. In the Houses database, open the report Grouped Town.
2. The report opens in preview and was created earlier. This is how the
report will look when printed.
3. The report covers approximately six pages (depending on how big the
footer area was made in the previous lesson). Click the navigation buttons
to confirm this. Select File | Page Setup.
4. The Margins tab allows the white space around the report to be altered,
note that it is in millimetres. Change all margins to 15mm and click OK.
The number of pages may decrease.
5. Click the Print button to print the whole report.
7. There are several paper and envelope sizes available from here, as well
as the orientation options. The actual options available will depend on the
type of printer that is connected. Select Letter, if available and change the
orientation to Portrait.
8. Click the Columns tab.
14. Alter the Top and Bottom margins to 30mm. Remove the check from
Print Data Only to reinstate the report headers and footers.
15. Click OK to view the result.
16. Select File | Print to view the Print dialog box. To print only specific
pages from a report, enter the start and finish number in the From and To
boxes.
17. Print pages 2 to 5.
18. Close the report and the database without saving any changes.
Manoeuvres
1. Open Staff database and the Reports object
2. The report Courses in the 1990’s was short term and is no longer
required.
3. Click on it, but do not open it.
5. In Design View, change the format of the fields to Britannic Bold, size
11. Check that all the data is still on view.
6. Close the report saving any changes and close the database.
8. Create a report based on the Mailing table, using the Report Wizard.
9. Select all of the fields for the report, but do not add grouping levels.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
3. Include the fields Surname, First Name, Date Joined, Current Club,
Past Clubs and Transfer fee.
4. Save the query as Commission.
6. Place all available fields on the report, view the data by Past Clubs and
group by Surname.
7. Sort by Date Joined and select to show the average transfer fee.
9. Choose any style, change the name of the report to Commission and
click Finish.
10. View the report. A calculation for the commission on each transfer is to be
added. Switch to Design View.
11. Draw a Text Box at the right of the Detail area. The label needs to be
moved.
12. Click on the label (it will show Text21 or similar) so that the handles are on
view.
13. Select Edit | Cut to remove the label. Click in the Page Header area and
then the Paste button to place the label at the far left of this area.
14. Move the label (use the hand) to an appropriate position above the
Unbound text box.
If you experienced any difficulty completing the Revision, refer back to the
Driving Lessons in this section, then re-do the revision.
Once you are confident with the features, complete the Record of Achievement
Matrix referring to the section at the end of the guide.
Answers
Driving Lesson 37
Step 8 Record 5
Step 9 Record 6
Driving Lesson 38
Step 11 Argentina (Record 2), Brazil (Record 6), Canada (Record 8), Mexico
(Record 26), Peru (Record 35) and USA (Record 46)
Step 14 Finland (Record 13), Libya (Record 25), Israel (Record 32) and
Norway (Record 34)
Driving Lesson 44
Step 8 There are 7 countries in the Middle East region.
Step 9 There are 9 capital cities beginning with B.
Driving Lesson 46
Step 2 There are 3 customers living in County Durham.
Driving Lesson 51
Step 2 There are 4 properties in Whitehaven.
Step 3 13 properties have 3 bedrooms.
Step 4 There are 6 properties in a Town beginning with C.
Step 5 There are 3 flats.
Step 8 There are 47 countries on the database.
Step 9 6 countries have English as their main language.
Step 10 Ehtiopia is first
Step 11 There are 26 non-European countries.
Step 12 Japan is the most densely populated country outside Europe.
Driving Lesson 52
Step 3 There are 4 records with Mr as the Title.
Step 7 There are 6 unpaid orders.
Step 12 Yes the Saab, registration E476 WSG
Step 13 Because the data type is not number
Driving Lesson 53
Step 8 There are 4.
Step 9 There are 3 men involved in sales.
Step 10 3 employees started work in 1985.
Step 11 Only 1 person is paid £15,000.
Step 12 The oldest member of staff is Ian Chapman (unless you have
added someone older).
Driving Lesson 64
Step 4 There are 5 properties in Cockermouth.
Step 6 There are 11 properties with a garage.
Step 7 There are 26 properties for sale
Step 8 There are 13 properties with three bedrooms.
Step 9 There are 4 properties in Whitehaven.
Step 10 There are 8 properties costing less than £22,000.
Step 11 There are 3 properties costing between 40 and 50 thousand.
Step 12 Whitehaven, 9 Deepdene, Listed Building.
Step 13 11 properties have offers on them.
Driving Lesson 65
Step 1 4 players earn more than £100,000
Step 7 7 repairs carried out on 02/01/02
Step 12 There are 4.
Step 13 3 staff have been on an introductory course.
Step 14 Mr Waldram.
Driving Lesson 75
Step 6 There are 18 houses.
Step 13 There are 13 schools.
Driving Lesson 83
Step 3 The report has 16 pages.
Glossary
AND A logical operator. Can be used in queries when a value
must satisfy all of the conditions.
AutoReport A report automatically generated by Access.
AutoForm A form created automatically by Access.
Field The separate areas in a table, which form Rows and
Columns and Records.
Foreign Key A primary key from table A, which is also used as a key field
in table B is called a Foreign Key.
Form A user defined display on the screen which controls how the
user interacts with the database.
Integer A positive or negative whole number (no decimals) or zero.
Long Integer A larger positive or negative whole number, or zero.
Macro An automated way of performing one or a series of actions.
One-to-many Any one record from table A may be related to one or many
records from table B.
One-to-one One record from table A is related to one record from table
B.
OR A logical operator. Can be used in queries when a value
needs to match at least one of two or more conditions.
Primary Key A field which uniquely identifies a record, e.g. telephone
number in a table.
Query A method of extracting specific information from a database.
Record A set of inter-related data.
Referential Integrity When applied to a relationship, data cannot be altered or
deleted in the second table, without the primary table first
being altered. This ensures the data in the tables is always
valid.
Relationships The ability to connect tables of data, so that no data need to
be repeated.
Report A hard copy of related data taken from a database.
Table A form of data storage consisting of Rows and Columns.
Validation Rules Defines the permitted entry into a field which the user can
make. Entries that do not conform to the rule cannot be
entered.
Wildcard Characters used in searches that allow one or many letters
to be replaced by the wildcard ( ? and * ).
Index
Adding Entering Data in a Table 30
Fields 44
Field
Records 72
Add New 44
Access Editing 35
Close 16 Properties 28
Start 9
Filtering 77
And Queries 97 Filter For 81
Auto Filters Excluding Selection 80
AutoForm 105 Using Filters 79
AutoReport 120 Finding Data 66
Calculated Fields 126 Format
Close Changing Column Width 64
Databases 16 Field Property 28
Tables 16
Forms 104
Column Width 64 AutoForm 105
Create Deleting 116
New Database 24 Designing a Form 109
New Form 105, 107 Editing a Form 111
New Report 120, 121 Editing Data 112
A Table Structure 25 Filtering 114
Printing 115
Databases 7
Sorting Data 112
Closing 16
Wizard 107
Creating a New Database 24
Opening 13 Grouped Report: Wizard 121
Principles 8 Help 11
Queries 85
Indexes 32
Window 15
Menus 10
Deleting
Forms 116 Moving
Queries 100 Columns 65
Records 58 Using the Keyboard 22
Relationships 54 Using the Mouse 20
Reports 130 Non-Matches 96
Tables 45 Online Help 11
Editing Open
Adding Records 30, 72 Application 9
Changing the Column Width 64 Existing Database 13
Deleting Records 58
Or Queries 99
Editing a Form 111
Editing Data 69, 71 Primary Key
Defining 31
Finding Data 66
Shortcuts 73 Printing
Undo 70 From a Table 42
Updating Records 58 Tables 40
Using Wildcards 67
Queries 85 Tables 19
And Queries 97 Closing 16
Deleting 100 Creating a Table Structure 25
Editing 94 Defining a Primary Key 31
Non-Matches 96 Deleting 45
Or Queries 99 Entering Data 30
Printing 91 Format Field Property 28
Querying a Table 86 Indexes 32
Ranges of Values 95 Querying a Table 86
Related Tables 92 Relationships 50
Saving 89 Using the Keyboard to Move 22
Sorting 89 Using the Mouse to Move 20
Querying A Table 86 Toolbars 10
Ranges Of Values 95 Undo 70
Records Validation
Adding 72 Rules 37
Deleting 58, 72 Text 37
Updating 58
Wildcards 67
Referential Integrity 57
Relationships 50
Applying 52
One-to-One 55
Referential Integrity 57
Reports 119
AutoReport 120
Calculations in 126
Deleting 130
Grouped Report Wizard 121
Modifying a Report 124
Printing 127
Revisions
Databases 17-18
Editing 74-76
Forms 117, 118
Queries 101, 102
Relationships 60-62
Reports 131-133
Sorting and Filtering 82-84
Tables 46-48
Searches
For Data 66
Non Matches 96
Sorting 77
Data 78
Queries 89
Record of Achievement
Matrix
This Matrix is to be used to measure your progress while
working through the guide. This is a learning
reinforcement process, you judge when you are
competent.
7 Forms 66 Forms
67 AutoForm
68 Form Wizard
69 Designing a Form
70 Editing Form Design
71 Sorting and Editing Data
72 Filtering a Form
73 Printing from a Form
74 Deleting a Form
8 Reports 77 AutoReport
78 Grouped Report Wizard
79 Modifying a Report
80 Other Calculations in Reports
81 Printing from a Report
82 Deleting a Report
ECDL Advanced
Have you enjoyed doing the standard ECDL? Well why not go one step further and
take the new ECDL advanced qualification? Materials are now available which follow
the same format as our successful ECDL core material.
Schools Editions
Specially written for older pupils, to be used by teachers, these guides integrate I.T.
into the curriculum and take the pupil through the features of various software
packages, with many revision exercises at the end of each section. Teacher's notes
are included. Products include guides to Word, Excel, Access and Publisher.
Trainer’s Packs
Specifically written for use with tutor led I.T. courses. The trainer is supplied with a
trainer guide (step by step exercises), course notes (for delegates), consolidation
exercises (for use as reinforcement) and course documents (course contents, pre-
course questionnaires, evaluation forms, certificate template, etc). All supplied on CD
with the rights to edit and copy the documents.
Purchasing Options
The above publications are available in a variety of purchasing options: as single
copies, class sets and/or site licences. However, Schools Editions and Trainer’s Packs
are only available as site licences.
Notes
Notes