INTRODUCTION
What is a Form?
An online form can be created to view, input or change
information in one or more tables. In this course, we will see how
forms are used as both menus and as data entry forms to database
tables. Forms can retrieve data from one or more tables, and
display the output on the screen.
What is a Report?
A report is an effective way to analyze and present data in a
printed format using a specific layout. You have control over the
size and appearance of information printed on the report, similar
to formatting you perform in a Microsoft Word document.
Challenge!
The best way to understand databases is to learn how to view the
world and the things in it, and then think of structures that best
serve to organize this information.
For example, think of your music collection in terms of a
database. The database might be called music collection. What
tables might be in this database?
Do you have both CDs and tapes, or just tapes? Could this
media type be an example?
Do you listen to different styles of music? Could music style
be a table?
Do you listen to different musical artists? Could musical artists
be a table?
Do you have more than one recording for any artist? Could
specific recordings be a table?
Here is your challenge:
1. Using the questions above, outline a structure using those
questions for which you answered "yes" (or any other questions
that you might think of).
2. List at least five items from your collection that could go into
each category created in step #1. If your music collection is not
large enough to list five items in each category, then think of
artists that you know about and use this information as if you
owned it.
3. After completing step #2, the database has some information
defined to it. What report might you want to print that tells
you about some part of the information in the database?
This step, looking at the information to be categorized, is the first
step toward designing a database.
What is a relational database? (continued)
The information contained in any one table might in and of itself
tell us very little. The Contact Types table, for example, provides
relatively little information that stands on its own: Family, Friends,
Relatives, Companies, Recruiters and Network.
However, if you could relate this table to the Contacts table --
name, address, and phone -- then you could separate contacts by
category. TheContact Types table becomes useful, therefore,
when related to another table.
Similarly, by relating the Calls table with the Contacts table you
can relate specific phone calls to specific people.
Introduction
By the end of this lesson, learners should be able to:
Identify the parts of the main Access window
Identify the parts of the database window
Understand the role of the design windows
Launching Microsoft Access from the Windows Desktop
Microsoft Access is launched from the Windows desktop in a
manner similar to that used to launch Microsoft Word, Excel, or
PowerPoint. You can launch Microsoft Access either from the
desktop shortcut or from the Start program.
To open Microsoft Access using the desktop shortcut:
Double-click the Microsoft Access shortcut icon on the
Windows desktop.
(If Access does not appear, then click the double down areas
immediately below the Microsoft PowerPoint entry and locate
Access from a complete list of software installed on your
computer.
The Main Access Window
When you open Microsoft Access, many items you see are
standard in most Microsoft software programs like Word, Excel,
and PowerPoint.
Menu bar
The Menu bar displays all the menus available for use in Access
2003. The contents of any menu can be displayed by clicking on
the menu with the left mouse button.
The Main Access Window (continued)
Toolbar
The pictured buttons in the toolbar are quick and easy shortcuts
to specific actions. For example, if you want to save a spreadsheet
using the menus then you would first click File and then
click Save. Using the toolbar to perform this save operation
actually saves you a click. Click the save button once to save the
spreadsheet.
Identify the operation performed by each button in the main Access toolbar.
Some buttons in the toolbar also appear alongside options listed in a menu. For each
button in the main Access toolbar, identify the menu where that operation can be
performed.
LESSON 4: DATABASE TABLES
Introduction
By the end of this lesson, learners should be able to:
Understand datasheet basics
Understand field properties
Understand table relationships
Understand the role of the primary key
Datasheet basics
The core component of a database is a table. Data is defined and
stored in a table. Multiple tables -- each consisting of different
types of data -- can be created in a database.
Each row in the database is called a record. The entry for John
Smith is called a record. The entry for Martha Tompkins is also a
record. Each row or record is made up of columns or fields --
L.Name, F.Name, Phone, Address, City, State, Zip -- which
contain a particular piece of information.
L.Name F.Name Phone Address City State Zip
100 Paramount
Smith John 919.555.6320 Morrisville NC 27560
Parkway
97
Tompkins Martha 919.555.6427 Hummingbird Cary NC 27513
Court
In a Contact Management database, a list of names -- those
contacts to whom you have sent resumes or have met through
your personal network -- might be maintained in a table, along
with address, phone number, and other personal information.
Field Properties
Every table contains a number of columns
called fields or datatypes. Fields are unique pieces of information
that make up the information in a table. Tables usually contain
multiple fields.
In a previous example we mentioned that a table might consist of
the fields: Last Name, First Name, Phone, Address, City, State,
and Zip. Each field has unique properties. Some contain
characters. Others contain numbers. These Field Properties are
defined when the table is created.
Understanding Table Relationships
Databases can be simple -- consisting of a single table -- or made
up of many different tables. If you were to convert your resume
into a database, for example, you might have a table that contains
your name and personal mailing address. We might call this the
Contact Information table.
Challenge!
Let us pretend that you are going to start your own home business.
You are going to need to prepare a database for your business and
the first step is to design a table that will contain a list of all your
contacts that may one day be your clients or suppliers.
Let us assume that a database table called Business Contacts
contains all the fields listed in the first column of the following
chart. The chart also contains four other columns:
Text, Numbers or Both -- should the field accept data entry
input in the form of text, numbers, or both?
Field Size -- the number of spaces you think the field should
have.
Required Entry -- should the field be required entry (the
record cannot be added to the database without the
information) or optional entry (a record can be added without
entry in the field)
Allow Duplicates -- should the database allow duplicate entries
for the field (e.g., can several people in the database share the
same zip code)?
Practice designing fields by filling out the following table.
Text,
Required Allow
Numbers, Field Size
Entry? Duplicates?
or Both?
First
Name
Last Name
Company
Company
Type
Address
City
State
Zip Code
Contact Id
Title
Work
phone
Fax
Number
LESSON 5: GETTING TO KNOW THE CONTACT MANAGEMENT DATABASE
Introduction
By the end of this lesson, learners should be able to:
Download a database from the Web
Open a database in Microsoft Access 2003
Understand the tables, forms, and reports in the Contact
Management database
Download the Contact Management Database
The Contact Management database used in this course can be
downloaded from the GCFLearnFree.org® Web site and
installed on your computer.
GCFLearnFree.org's Access 2003 lessons all use examples from
the Contact Management Database. However, if you'd rather work
with another existing database, you should have little problem
following our lessons.
To Download the Contact Management Database:
Click the link, and download and save the Contact
Management database (992k).
Introduction
By the end of this lesson, learners should be able to:
Launch the database wizard
Create a database using the database wizard tool
Launching the Database Wizard
The Contact Management database was created using the
Microsoft Access Database Wizard. We will briefly review the
steps involved in creating this database.
Microsoft Access 2003 is equipped with a database wizard that can
be used to create any of ten simple databases: Asset Tracking,
Contact Management, Event Management, Expenses, Inventory
Control, Ledger, Order Entry, Resource Scheduling, Service Call
Management, and Time and Billing.
In this lesson we will briefly review the steps involved in creating
the Contact Management database.
How the Contact Management Database was Created Using the
Database Wizard:
Choose File New from the menu bar.
Click once on the Databases tab near the top of the New
window.
If the Templates window does not show, you may need to
select On my computer from the task pane on the right side of
your screen.
Challenge!
Review the Database Wizard screens shown in this lesson.
These are the same screens used to create the Contact
Management database.
Open Microsoft Access.
Choose File and then New from the menu bar.
Select On my computer... under the Templates section of
the Task Pane.
Select the Expenses database. This is a good example of a
database that could be used by a business to track expenses.
Follow the steps indicated by the wizard to create the database.
Make sure the box beside Yes, start the database is checked
on the screen of the wizard.
Navigate through the database by selecting various forms,
tables, etc.
Introduction
By the end of this lesson, learners should be able to:
Open a table in Datasheet View
Navigate through table records and across fields
Understand the function of the Record Selector field
Opening an Existing Table in Datasheet View
Tables are created and maintained in the Tables tab of
the Objects palette in Microsoft Access. The Contact
Management database contains four tables: Calls, Contact Types,
Contacts, and Switchboard Items. We will discuss the Contacts
table in this lesson.
A table opened in Datasheet View resembles a Microsoft Excel
spreadsheet. It is used to input records into the database and will
be discussed in this lesson.
To Open an Existing Table (Contacts) from the Tables Object:
Open the Contact Management database.
In the database window, click on the Tables tab from
the Object palette.
(You could also either click once on the Contacts form and
then click the Open button, or you could right-click on
the Contacts form and select Open from the shortcut menu.
Using the Status Area to Navigate through the Records in a Table
The Datasheet View looks like an Excel spreadsheet. It consists of
columns and rows. Field names -- Contact ID, First Name, Last
Name, Dear, Address, City, State, etc. -- appear as column
headings. Records represent rows with data input into the fields.
The number of rows that appear in the table will equal the
number of records that have been added to the table. One blank
row always appears as the last row of the database. This blank row
is used to add a new record the table.
The status area in the lower left area of the window indicates the
number of records in the table as well as the record number
displayed in the window.
Drag the Adjustment tool left or right to the desired width and
release the mouse button.
Joe Smith, 44 Highhouse Road, Cary, NC 27513, United States, 111-11-1111 (Social Security
Number), 40 (Employee Number), Salesperson (Title), 919-555-1212 (Work Phone), and 100
(Extension).
Jane Allen, 123 Atlantic Avenue, Raleigh, NC 27516, United States, 222-22-2222 (Social
Security Number), 56 (Employee Number), Director of Sales (Title), 919-555-1234 (Work
Phone), and 200 (Extension).
Pete Moss, 567 Helix Court, Raleigh, NC 27606, United States, 333-33-3333 (Social Security
Number), 75 (Employee Number), Clerk (Title), 919-555-5678 (Work Phone), and 300
(Extension).
Resize the Social Security Number column using the menu bar method.
Resize the Employee Number column using the manual adjust method.
Resize the State/Province column using the auto-fit method.
Save and close the document
.
LESSON 9: EDITING AND DELETING TABLE RECORDS
Introduction
By the end of this lesson, learners should be able to:
Edit a field in a table record in Datasheet View
Cut, copy, and paste table records
Use the Undo feature
Check the spelling of data
Delete table records
Editing a Table Record in Datasheet View
Information in a record is likely to change over time, when
someone moves from one address to another, or when someone
else changes his or her phone number. Information can be
changed in any field of any table record.
To Edit a Single Word in a Field:
Move the mouse over the field you want to edit. The mouse
pointer changes to an I-beam.
To add characters to the field information (e.g., a letter needs
to be added to a word), click once in the field at the spot
where the information needs to be changed. An insertion
point | appears.
To overwrite a word in the field (e.g., "Road" needs to change
to "Street"), double-click (or click-and-drag across the word) on
the word in the field. Type the new information directly over
the highlighted word.
To Edit an Entire Field:
Sometimes, you will need to change the entire contents of a field
(e.g., someone has a new address). In Access, you can select an
entire field for editing.
Move the mouse pointer to the left edge of the field you want
to edit.
The mouse pointer changes to a selection tool, a large cross.
Click to select the field.
Type the new information.
Warning! When attempting to edit an entire field, be careful
not to move the mouse pointer so far to the left that you click on
the Record Selector (pointer changes to an arrow pointing right)
and select the entire record. In Access, you cannot edit fields
when the entire record selected.
Saving Your Work: Unlike the Word, Excel, or PowerPoint
applications, you will not be prompted to save the data you
entered when you exit the screen or close application. In Access,
each record is saved automatically when you move to another
record.
Cutting, Copying, and Pasting Table Records
Cut, Copy, and Paste are very useful operations in Microsoft
products, including Access 2003. These operations allow you to
quickly copy and/or cut information in fields for pasting into other
fields. These operations save you a lot of time from having to type
and retype the same information.
The Cut, Copy, and Paste buttons are located on the Standard
toolbar.
(or hold the Shift key and click the Record Selector field in
each consecutive record to be marked for delete.)
Press the Delete key to mark the records for delete, click
the Delete Record button, or choose Edit Delete from the
menu bar.
A dialog box is displayed to confirm the record(s) to be
deleted. Click the Yes button to complete the delete
operation.
Important to Remember:
Deleting records is permanent. It cannot be reversed through
an Undo operation. Use caution when the dialog box is displayed
to confirm the record(s) to be deleted.
Challenge!
Open theExpenses database you created.
Edit theJane Allen record by changing the word "Avenue" in the
Street Address to "Road."
Navigate to the Joe Smith record, cut the City entry and then
type "Apex" as the new City.
CopyJane Allen's Work Phone and paste it in Pete Moss's Work
Phone.
Delete theJoe Smith record
Save and close the document.
LESSON 10: ADDING FORM RECORDS
Introduction
By the end of this lesson, learners should be able to:
Open a form using the Forms Object button
Navigate through the Switchboard Menu
Navigate through records in a form
Add new records to the Contacts table
Add new records to the Calls table
Add new records to the Contact Types table
Opening Forms in the Contact Management Database
Forms can be opened several ways in the Contact Management
database. When the Contact Management database is first
opened, a main switchboard of menu items is automatically
displayed. A form can also be displayed by opening it from the
Forms object.
If a table has been defined to a database, it does not matter
whether records are inputted into the table using the Datasheet
View discussed in lesson 7, or through a data entry form presented
in this lesson. Both methods update the same table.
To Open a Form from the Forms Object:
Open the Contact Management database.
In the database window, click on the Forms tab from
the Object palette.
In the right white pane, double-click the Contacts form
(You could also either click once on the Contacts form and
then click the Open button, or you could right-click on
the Contacts form and select Open from the shortcut menu.
Using the Contact Management Main Switchboard
The Contact Management database has been created in such a
way that you may never have to access a table in Datasheet View.
Forms have been created and linked together in a menu structure
to allow you to navigate quickly and easily to different forms.
These forms collectively retrieve information from or are used to
input and update records in any given table in the Contact
Management database.
To Open a Form Using the Main Switchboard Form:
The Main Switchboard form automatically loads each time the
Contact Management database is opened. You can manage all the
contact information in the database by using any of the forms
linked to the Switchboard.
The Main Switchboard form lists five options:
Enter/View Contacts is selected to enter contact information,
or the specifics about a given phone call, in the database.
Enter/View Other Information is an administrative function
that allows you to define Contact Types (e.g., family, friends,
relatives, etc.).
Preview Reports provides access to different reports.
Change Switchboard Items (will not be discussed in this
course).
Exit this database is selected to exit the Contact Management
database.
To display any of the Contact Management subforms:
Click on the option you want to access. For example, click on
the Enter/View Contacts menu selection to add new records to
the Contact Management database.
The Contacts Table: Adding Records Using the Enter/View
Contacts Form
The Contacts form is used to add or change information in the
Contacts table. The only time the Contacts form is blank is when
the new table to which it is associated does not yet have any
records added to it. Otherwise, information reflecting the first
record in the table is presented when the form is displayed. When
adding new records, you are required to input information in the
required fields of a blank data entry form.
To Add a Contact Record:
Click on the New Record button to display a blank data entry
form. A blank entry form is displayed.
Type the requested information in each field on the form. If
the field label reads, First Name, type the first name of the
individual being entered into the database.
Press Enter or Tab to move from one field to the next, or
click in the field using your mouse.
Complete entries in the remaining form fields: Last Name,
Company (if applicable), Address, City, State/Province, Postal
Code, Country, Title, Work Phone, Work Extension, Mobile
Phone, and Fax Number fields.
When finished entering information on this page, click the
Page 2 button to display additional fields.
On page 2, complete entries in the Contact Type, Email
Name, Referred By, and Notes fields.
Saving Your Work: Unlike the Word, Excel, or PowerPoint
applications, you will not be prompted to save the data you
entered when you exit the screen or close application. In Access,
each record is saved automatically when you move to another
record or exit the form.
The Calls Table: Adding Records Using the Calls Form
The Calls form is used to add details about specific phone calls to
the the Calls table. It is accessed by using the Calls button on the
Contacts form. If looking for a job, for instance, and several calls
are made to a company, then you can use the Calls table to record
a history of notes about each phone call.
Introduction
By the end of this lesson, learners should be able to:
Review table records and form records concepts
Perform a simple sort
Perform a multi-field sort
Remove a sort
Save a sort
Sorting Records to Find Information
Sorting is one method that helps you find information quickly and
easily in a database. Records can be sorted in ascending order (A-
Z), anddescending order (Z-A). You can sort by zip code, last
name, first name, company, contact type (e.g., family, friend,
relative), etc. You can even sort by contact type and then by last
name within each contact type.
It's easiest to see the results of a sort if you work in Datasheet
View.
To Sort Records:
Open the desired form or table (e.g., Contacts table).
Choose View Datasheet View from the menu bar if
Datasheet View is not already displayed.
Click anywhere in the column you want to sort by (e.g., Last
Name).
Click the Ascending or Descending button on the toolbar (or
choose Records Sort Sort Ascending or Sort
Descending from the menu bar).
To sort by Form View, switch to Form View, select the field you
want to sort by, and click the Sort button on the toolbar. To see
the results, use the status area to move through the records.
Performing a multi-field sort
Multi-field sorting allows you to define multiple fields in your sort.
You specify the column to sort by, (e.g., Last Name), and within
that column sort by some other specified field (e.g., First Name).
For example, you could sort all the Brown records by first name.
Saving a sort
When you open a table in Access -- any table -- the records are
displayed in order based on values that appear in the primary key
field. In other words, Access defaults to a sort on the primary key
when a table is opened. A sort can be performed against any field
listed in a table, however. Sorting table records actually change the
table design. When you attempt to close a table after a sort,
Access will prompt you tosave the changes to the table design.
To save a sort:
Exit the table
Click the Yes button in response to the question, Do you want
to save changes to the table?
The sort order is saved. When you open the table again, the
records will still be sorted.
To cancel a sort:
Exit the table
Click the No button in response to the question, Do you want
to save changes to the table?
Click the Find Next button to search for the first occurrence of
a record that matches the search.
Performing a Simple Find (continued)
Click the Cancel button if the record was found. The Find and
Replace dialog box will close.
OR
Click the Find Next button to search for the next record that
meets the Find criteria.
In the event that Access did not find a match for the search, the
Office Assistant will pop up to inform you that there were not any
matched records found.
Matches any
? single Sp?ll finds spell
(Question alphabetic and spill.
Mark) character
Matches any
# single numeric 9#1 finds 901, 911,
(Pound Sign) character 921, etc.
Removing a Filter
To Remove a Filter:
Click the Remove Filter button on the standard toolbar or
choose Records Remove Filter/Sort from the menu bar.
The records revert to their ordering before the sort was
applied.
All records except the criterion you excluded are now visible.
Select a filter value from the drop down list (e.g., North
Carolina, to view all records in North Carolina).
To display records meeting more than one search criteria,
click the Or tab located at the bottom of the screen.
Otherwise, continue to the next step.
Click the Apply Filter button to apply the filter and view the
filtered records.
Challenge!
Open the Content Management database.
Open the Contacts table in Datasheet View.
Filter by Selection on any record that reveals a City of "Apex."
Remove the filter.
Perform a Filter Excluding Selection on any record that
reveals a City of "Raleigh."
Remove the filter.
Filter By Form on the City of "Raleigh."
Remove the filter.
Close the Contacts table, and if displayed, click the NO button
in response to the Do you want to save changes to the design
of table 'Contacts' system prompt.
LESSON 15: RUNNING DATABASE QUERIES
Introduction
By the end of this lesson, learners should be able to:
Run an existing query
Create a Single-table query
Create a Multiple-table query
Run an Existing Query
Like tables and forms, a query is another type of database
object in Access 2002 XP. A query is a search for records that
match the exact criteria you define. In this example, we will run a
query against the Contacts table and list all records found by Last
Name, First Name, and Work phone.
If the fields you selected include a number field, you are asked
to select a summary or detail query. To see each record,
choose Detail. To see sums, averages, etc.,
choose Summary and set the summary options. Click
the Next button.
Type a name for the query (e.g., Contacts Mailing Address) in
the What title do you want for your query? field.
(Leave the Open the query to view information radio button
turned on).
Introduction
By the end of this lesson, learners should be able to:
Run Contact Management database reports
Create a report using AutoReport
Create a report using the Report Wizard
Running Contact Management Reports
The Contact Management database contains two reports that you
can use to print a complete list of contacts in the database
(Alphabetical Contact Listing Report), as well as a call log to recap
phone-call summaries made between any two dates (Weekly Call
Summary Report).
To run the Alphabetical Contact Listing Report:
On the Main Switchboard form, click once on the Preview
Reports menu selection.
On the Reports Switchboard, click once on the Preview the
Alphabetical Contact Listing Report menu selection.
The Alphabetical Contact Listing Report is displayed.
After you have created a report, you will be asked to save the
report when you close it or exit Access. When you save a report,
only the structure of the report is saved and not the underlying
data seen in print preview.
Creating a Report Using the Report Wizard
Another way to create reports in Access is to use the Report
Wizard. The Report Wizard asks a series of questions that you
must answer. Access uses your responses to create the report.
To Create a Report using the Report Wizard:
Open the database window and choose the Reports option
from the Object palette.
Click the New button to open the New Reports dialog box.
Click on the Report Wizard selection.
Choose the table or query in which you would like to base the
report.
Highlight the first field from the Available Fields that will be
included in the report and click the right arrow to move the
field to theSelected Fields box.
Repeat so that each field is included in the report, or the click
the double arrow to move all the fields for the report.
When finished, click the Next button.
In the Report Wizard's second dialog box, you can select a field
name for grouping purposes. For example, by selecting First
Name, notice how First Name becomes the group header (blue
text) in the right side of the picture. You do not have to select any
grouping levels.
Highlight the field that you would like to use as a group level,
and click the right arrow to move the field to the Selected
Fields box.
When finished or to bypass this screen, click the Next button.
Creating a Report Using the Report Wizard (continued)
In the Report Wizard's third dialog box, you can specify how or if
the reports are to be sorted on the report. For example, if you
wanted to show names alphabetically and by state, you would first
sort by State and then by Last Name.
In the first field (optional), select a field name from the drop-
down box only if records in the report are to be sorted by that
field. Then, click the button to define whether records are to
be sorted in ascending or descending order.
If necessary, repeat for each of the remaining three sort fields.
When finished or to bypass this screen, click the Next button.
In the Report Wizard's fourth dialog box,
Select one of the three listed Layout options: Columnar,
Tabular, or Justified.
Select an Orientation for the report, either Portrait or
Landscape.
(Optional), select or deselect the Adjust the field width so all
fields fit on a page field.
Click the Next button to continue.
Creating a Report Using the Report Wizard (continued)
In the Report Wizard's fifth dialog box,
Click through the different format options displayed on the
screen -- Bold, Casual, Compact, etc., to display a picture of
each report format on the left side of the wizard screen.
Highlight the desired format you would like to use.
Click the Next button to continue.
In the Report Wizard's sixth dialog box,
Assign a name to the report by typing a file name in the What
title do you want for your report? field.
Click the Finish button to complete the wizard and generate
the report.