Professional Documents
Culture Documents
What you will do: When you need a flexible system for organizing and analyzing a large
amount of data, it’s a good idea to build a database. Microsoft® Access
Explore the 2002 adds valuable capabilities to the proven Access database
features of technology. It offers new ways to view data, along with compatibility
Access 2002 and integration with other programs.
Create a This chapter will show you how to use Access 2002 to:
database
Create a table • Build a database. Plan and create a database; create a table;
add fields and data to the table.
Add data to a
table • Manage data. Sort records; use filters to sort data; create and
Sort records run a query.
Use filters and
• Analyze data. Create and use forms to access and analyze
queries
information in a database; create Microsoft PivotTable® and
Create a form Microsoft PivotChart® dynamic views.
Add data through
• Report findings. Create a report based on an aspect of the
the Web
data collected.
Create PivotTable
and PivotChart For example, if you’re beginning an assignment on the history of
views shipwrecks in the Great Lakes, and you need to obtain data from
Create a report various sources and use a filter to sort data, it makes sense to store
your records in a database. You can use Access 2002 not only to store
all kinds of information, but also to analyze the data and create
professional reports.
Access 2002
• Compatibility with Access 2000. You can work with and modify
Access 2000 files in Access 2002 without converting the file
format.
use to manage and present data. These components are also called
database objects. When you build a database, you create as many of
these objects as you need, and Access 2002 stores them in one
database file. Each object you create in the database is dependent on
other objects. That is, a query, form, or report draws information from
tables, so changing data in any one of these objects changes the data
in all of these objects.
You create and open database objects from the Access 2002 database
window, which lists the objects in the left pane of the window. When
you click one of the first five items, the right pane gives options for
creating the object, and it shows all existing objects of that type in the
database. You can open an object by double-clicking it.
Exploring tables
Field
Record
Brainstorm with your class about the questions that you would like
the database to answer, and the reports that you would like the
database to produce. For example, you might want to look at the
causes of shipwrecks and whether those causes changed over the
years as ship construction evolved, leading to a report on how
future wrecks can be prevented. Or, your students can gather data
first and then look for patterns in where, when, or how shipwrecks
occur. Think about the information sources that you want to use to
obtain data.
• Create fields for data that contains only one item, not lists of
multiple items. For example, instead of creating one field for
ship dimensions, create separate fields for length, width, and
weight. To ensure that you can sort and filter data effectively,
make sure your fields contain discrete data types.
3. In the New File task pane, under New, click Blank Database.
5. Type all the other fields in the Field Name column, and
select the corresponding data type for each.
6. Click the field that you want to be the primary key, and
then on the toolbar, click the Primary Key button .
7. Click the Save button. In the Save As dialog box, type the
name of the table (for example, All Ships), and then click
OK.
9. Close the table in Design view. You can see that the table is
contained in the database window.
Adding data
For now, don’t worry
about the order of the
records you intend to After you create your tables and the fields within those tables, you
add. You can organize are ready to add data.
them later.
5. When you reach the end of the first record, press TAB or
the RIGHT ARROW key to move to the next record in the
table.
New record
Next record
First record
Previous record Last record
To find a record
1. Open the table, and then activate the field for which you
plan to enter a value. For example, if you want to find the
record for the ship Lady Elgin, click Ship Name so that the
whole column is selected.
3. In Find and Replace dialog box, in the Find What box, type
what you are looking for. For example, type Lady Elgin
5. When you find the item, click Cancel to close the Find and
Replace dialog box.
Managing Data
After you add data to your database, you can use the sort, filter, and
query features in Access 2002 to organize the data in more meaningful
ways.
Sorting data
Using filters
• Filter By Form. Use this option when you want to choose the
values you’re searching for from a list without scrolling through
all the records, or when you want to specify multiple criteria at
once.
• Filter By Selection. Use this option when you can easily find
and select the value you want the filtered records to contain.
• Filter For Input. Use this option when the focus is in a field and
you just want to type in place the exact value you’re searching
for or the expression whose result you want to use as your
criteria, or when you want to specify multiple criteria at once.
To filter by form
1. With the table open in Datasheet view, on the toolbar, click
the Filter By Form button to switch to the Filter by Form
window.
4. When you want to view the full table again, on the toolbar,
click the Remove Filter button.
Note When you run a filter, the Apply Filter button becomes
the Remove Filter button.
To filter by selection
1. With the table open in Datasheet view, click the item that
you want to use to filter data. For example, if you want the
table to show only those ships that sank due to storms (so
you can see what else those ships might have in common),
click storm in any record in the table.
3. When you want to view the full table again, on the toolbar,
To use the other two
methods of filtering,
click the Remove Filter button.
see Access 2002
Help.
Using queries
Queries are great for viewing only certain data contained in a table.
You establish a set of criteria when you create the query. Then,
when you run the query, Access 2002 returns only those fields or
records that are of interest to you. The results appear in a table in
Datasheet view.
Select queries are similar to filters in that you can use either to:
• Sort records.
• Choose the tables containing the records you want to work with
and add more tables at a later date if necessary.
3. For each field that you want to include in the query, click
the field in the Available Fields box, and then click the
forward arrow to move the field to the Selected Fields
box. For example, add the Ship Name, Type of Ship, Year
Sunk, and Cause of Sinking fields. Click Next.
After you create a query and save it in the database, you never
need to create that query again. When you change or add new
records, the new data automatically appears in the query the
next time you run it. Likewise, whatever changes you make in
the query appear in the full table.
To run a query
1. In the database window, under Objects, click Queries.
SQL queries
Using Forms
Forms make it easy for you and your students to access information in
a database. You can use a form to focus on one record at a time for
viewing, adding, and deleting data. In addition, you can customize a
form to view and print information in a style that you like—you can
even add pictures to make the form more visually appealing. If you
want to organize fields into subcategories, you can create a multipage
form.
Creating forms
The easiest way to build a form is by using the Form Wizard. The
Form Wizard helps you choose the layout of records in the form and
also the background, color, and format of the display. You can also
preview the layout and style options when you create a form by
using the Form Wizard.
To create a form
1. In the Shipwrecks database window, under Objects, click
Forms, and then double-click Create Form by using wizard.
The form opens in Form view, which is the default view when you
open a form. You can enter information in a form through Form view
or Datasheet view. Any changes you make to a record in a form
automatically appear in the table that the form draws information
from.
To customize a form
You can customize the form in a number of ways. For example,
because there is a finite number of Great Lakes, you can change
the text box under the Lake field to a combo box to make entering
data in that field faster (and to minimize possible data-entry
errors).
1. In the open form, on the toolbar, click the arrow next to the
View button, and then click Design View.
• In the Combo Box: Lake dialog box, on the Data tab, click
the Row Source Type box. In the list that appears, click
Value List. In the Row Source Box, type
Erie;Huron;Michigan;Ontario;Superior and then close the
dialog box.
• In the Insert Picture dialog box, locate the image file that
you want to insert, and then click OK.
4. Select the fields that you want your data access page to
include. To base the data access page on the full All Ships
table, select all the fields by clicking the double forward
arrow. Click Next.
7. Type a title for the page, click Open the page, and then
click Finish.
Although you create the data access page in Access 2002, it is not
stored in the database. Data access pages are saved as HTML files
in one of the Windows desktop folders; Access 2002 then adds a
shortcut to the file in the database window.
2. Browse to the folder where you want to store the HTML file.
3. Click Save.
With Access 2002, you can perform data analysis and build rich
PivotTable and PivotChart views more quickly than ever before. For
example, you can open a query in PivotTable view or PivotChart
view to analyze data. You can rearrange row headings, column
headings, and filter fields until you achieve the desired layout. Each
time you change the layout, the form immediately recalculates the
data based on the new arrangement. PivotTable and PivotChart
views can be saved as data access pages that can be viewed by
anyone who has Internet Explorer 5 or later.
You see a blank PivotTable view without any fields or data; you
now must add the fields from the PivotTable Field List dialog
box, which appeared on the right side of your screen.
Note You can open and close this dialog box by clicking the
Field List button on the toolbar.
3. In the PivotTable Field List dialog box, drag each field to the
place where you want it to appear in the PivotTable view.
For example, if you want to compare types of ships and
causes of sinking, drag the Type of Ship field to the area for
column fields, and drag the Cause of Sinking field to the
area for row fields.
Creating Reports
After you and your students add information to the Shipwrecks
database, you may want your students to report on some aspect of the
data they’ve collected. Reports let you customize the display of
information from the database. You can select the data you want to
include—for example, a particular query—and then select the report
layout from a variety of design and format options. You can insert
pictures; add headers, footers, and page numbers; group the
information; and change the background colors, among other things.
You can create different types of reports quickly by using wizards. For
example, the Label Wizard creates mailing labels, the Chart Wizard
creates charts, and the Report Wizard creates a standard report. For
your first report, use the Report Wizard. The Report Wizard asks you a
series of questions to help you design the data exactly as you want.
After you create the report, you can open it in Design view to modify its
structure.
To create a report
1. In the Shipwrecks database window, under Objects, click
Reports.
This procedure is the
quickest way to 2. Double-click Create report by using wizard.
access the Report
Wizard. To see the
other report options, 3. In the Tables/Queries list box, click the table or query from
follow step 1. Then, which you want to generate a report. For example, select
on the database the Shipwreck Causes query from the list.
window toolbar, click
the New button.
4. Select the fields that you want your report to include. To
base the table on the full Shipwreck Causes query, select
all the fields by clicking the double forward arrow. Click
Next.
7. Click the option buttons to view the different options for the
layout and orientation of your report. Decide which ones
you want, and then click Next.
8. In the list, click the style that you want for the report, and
then click Next.
9. Type a title for the report, click Preview the report, and then
click Finish.
Taking It Further
As you explore the new features of Access 2002, you will continue to
think of new ways to manage information. You can try the following
activities to experiment further: