Académique Documents
Professionnel Documents
Culture Documents
Tutorial:
Access 2007
Access 2007 is the database application in the Microsoft Office 2007 suite. Get
Access help designing an Access database and sorting and filtering records, among
other tasks.
Understanding Database
Concepts
1 Why Do I Need a Database?
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
2
10 Sorting Records
11 Filtering Records
Extras
Quiz
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
3
Access 2007:
Why Do I Need a Database?
INTRODUCTION
WHY DO I NEED A DATABASE?
What is a database?
Why not use Excel?
EXCEL EXAMPLE: CUSTOMER LIST AND ORDER TRACKING
Sorting and filtering to locate data in Excel
Data entry in Excel
ACCESS EXAMPLE: CUSTOMERS AND ORDERS TRACKING
Entering data in Access
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
4
What is a database?
A database allows you to store information related to a
specific topic in an organized way. In addition to storing data,
you can sort, extract, and summarize information related to
the data. One of the software programs that allows you to do
this is Microsoft Office Access 2007, which is a database
creation and management program.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
5
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
6
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
7
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
8
In this example, the Customer Info and Orders tables are linked
by Customer ID and Book ID.
Now, let's assume that you want to identify the book that was
most popular in the state of North Carolina. With Access, this is
possible because you can search and retrieve information from
multiple tables at the same time.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
9
Challenge!
Try to answer these questions:
What is a database?
What type of software program is Microsoft Excel?
What type of software program is Microsoft Access?
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
10
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
11
Access 2007:
Exploring an Access Database
INTRODUCTION
EXPLORING DATABASES
Databases in our lives
Think about it
GETTING STARTED WITH ACCESS
OPENING A DATABASE
To view templates included with Access
To open an existing database
THE ACCESS WINDOW
The Ribbon
The Quick Access toolbar
The Microsoft Office button
The navigation pane
To open and close the navigation pane
PARTS OF A DATABASE
To change how objects are ordered in the navigation pane
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
12
Introduction
Exploring databases
Watch the video! (Part 1) (5:16min) (Part 2) (3:26min)
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
13
Think about it
Think about what is going on around you in everyday
situations and whether there might be a database at work.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
14
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
15
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
16
Opening a database
You have three main options on the Getting Started page. You
can open a template database stored locally or online, an
existing database, or a blank database.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
17
In the left pane of the Getting Started window, you will see a
list of categories for the templates available on Office Online.
You must have an Internet connection to download these
database templates.
OR
Click the More link. A dialog box will appear.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
18
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
19
The Ribbon
Like other software in the Microsoft Office 2007 suite, Access
2007 has a tabbed Ribbon system you use to navigate the
database. The Ribbon is organized into tabs. Each tab
contains groups of commands you use to perform tasks in
Access.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
20
Once you are familiar with Access, you may find that there are
commands you use more often than others. To make it easier to
use these commands, you can add them to the Quick Access
toolbar. By default, the toolbar appears above the Ribbon on
the left side of the Access window and includes the Save, Undo,
and Redo commands.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
21
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
22
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
23
Parts of a database
A Microsoft Access database is made up of several components,
including tables, forms, queries, and reports. These
components are called database objects. One or more of
these objects is formed when a database is created, and all of
the objects appear in the navigation pane. To make the
database easier to navigate, beginner Access users may want
to reorder objects in the navigation pane.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
24
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
25
Parts of a database
A database is made up of several components, or objects.
These objects include:
Tables
Queries
Forms
Reports
We'll look at each of these objects in more detail in later
lessons, but you can access them from the navigation
pane like you can with tables.
Tables
A table is the database object that contains the basic
information you want to store. A blue and white icon represents
the table in the navigation pane.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
26
Queries
Another database object is called a query. A query allows you
to retrieve information from one or more tables based on a
set of search conditions you define using the table fields.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
27
For example, if you want to know the name of the books that
have sold in Colorado and Kansas, you could create a query
that would retrieve information from multiple tables to
determine the answer. In this example, you would retrieve
information from the Order Info table and Books table. Queries
are covered in more detail in later lessons.
Forms
A third database object is the form. Forms are an Access tool
you can create to make data entry in database tables easier.
Reports
The final database object is the report. A report is an effective
way to analyze and present data using a specific layout. The
text can be formatted in an Access report, just like it can be in
Word documents.
To close an object:
Select the tab for the object you want to close. (The
highlighted tab is the active tab).
Right-click the tab, and select Close from the menu.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
28
Challenge!
See if you can answer these questions:
Access 2007:
Thinking about Database Design
INTRODUCTION
DESIGNING A DATABASE
The Ready-2-Read bookstore scenario
Determine the purpose of the database
Plan database tables
Plan table fields
CHALLENGE!
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
29
Introduction
Designing a database
Watch the video! (4:22min)
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
30
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
31
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
32
The Orders table will have fewer fields. We'll need this table to
track the Customer who is placing the order, the Book the
customer is ordering, and the Date the order is placed.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
33
Challenge!
Let's imagine that you want to use a database at your new
coffee shop. Plan your database by answering the following
questions:
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
34
Access 2007:
Setting up Tables and Fields
INTRODUCTION
SETTING UP TABLES AND FIELDS
CREATING A NEW DATABASE WITH ACCESS
SETTING UP TABLES
NAMING A TABLE
To rename a table
To close a table
To open a table
ADDING MORE TABLES TO THE DATABASE
ADDING FIELDS TO A TABLE
To switch views
Adding fields in Datasheet view
Adding fields in Design view
Moving fields
Deleting fields
SETTING THE DATA TYPE FOR A FIELD
To change data type from the Ribbon
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
35
You will also see the New Blank Database option, which
allows you to build your own database from scratch.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
36
When you choose the New Blank Database option at the top
of the window, you will be prompted to rename the database
from the default name, which is Database1.accdb. Rename
the database whatever you want. In the example below, we
named the database Ready2Read because it's the name of
the store in our scenario.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
37
Setting up tables
The new database opens with one table showing as a default. It
also defaults to naming this table Table1 in both
the navigation pane and the Table tab itself. You will want to
name your tables based on your database design plan.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
38
Naming a table
To give the table a unique name, you must first click on
the Microsoft Office button in the upper-left corner of the
application.
Next, select Save from the menu. The Save As dialog box will
appear to let you save the table whatever name you want.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
39
The new table names appear in both the navigation pane and
the Table tab itself, as you can see in the picture below.
To rename a table:
With the table closed, right-click the Table you want to
rename in the navigation pane. Select the Rename option
that appears in the menu.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
40
To close a table:
There are several ways to close an active table. You can right-
click the Table tab and choose Close from the menu.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
41
To open a table:
To open a table, right-click the Table name of the table you
want to open in the navigation pane, then choose Open from
the menu.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
42
TIP: You can tell which table you are currently in by seeing
which table tab is highlighted.
To switch views:
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
43
Select the Views command group from either the Home tab
(seen below) or the Datasheet tab on the Ribbon. Select the
view option you want from the menu.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
44
The Add New Field text will disappear from the header. Name
the field by typing the name directly into the header. Press
the Tab key on your keyboard to move to the next field.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
45
Moving fields
If you want to rearrange the order in which your fields appear in
a table, Access 2007 lets you easily move them around. To
move a field in Datasheet view, drag and drop the field to the
location you want. To do this:
Click the field header for the field you want to move.
Move the mouse in the area of the header.
When the cross with arrows appears, hold down your left
mouse button.
With the left mouse button still held down, move the
cursor to where you want the field to appear.
Release the mouse button, and the field appears in its
new location.
Deleting fields
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
46
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
47
Click the field name, then press the Tab key on your keyboard.
From the drop-down menu under the Data Type column, select
the format you want.
Challenge!
Open Access 2007 and build your own database. Then do the
following:
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
48
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
49
Access 2007:
Building Table Relationships
INTRODUCTION
BUILDING TABLE RELATIONSHIPS
To establish a relationship between tables
To move a table that appears in the relationship map
UNDERSTANDING THE RELATIONSHIP MAP
Primary and foreign keys
RELATING TABLES
To relate tables with the drag-and-drop method
Understanding types of relationships
One-to-Many
Enforcing referential integrity
Editing existing relationships
CHALLENGE!
Introduction
By now, you've set up the tables you need for your database
and have created fields for the different
tables. Relationships provide Access 2007 with the means to
bring this information together for you when you need it.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
50
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
51
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
52
In the example above, the primary key for the Customers table
is Customer ID, the primary key for the Orders table is Order
ID, and the primary key for the Books table is Book ID.
A foreign key is a field that is the primary field in its own table
but that shows up in another table. If you look closely at the
Orders table, the fields Customer ID and Book ID appear
there, as well as in their own respective tables. These fields are
the primary key in their own tables, but in the Orders table,
they are considered foreign keys.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
53
Relating tables
There are a few ways to establish relationships between tables:
Drag the field name from one table to the other table in
the desired relationship.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
54
Drop the first field name onto the field name you want to
relate by releasing the left mouse button.
In the example above, we selected the Book ID field from
the Books table and dragged and dropped it on the Book
ID field in the Orders table.
The Edit Relationships dialog box appears.
One-to-One
One-to-Many
Many-to-Many
The relationship type you will come across most frequently
and the one created in our bookstore scenariois the One-to-
Many relationship.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
55
One-to-Many
The One-to-Many relationship means data for that field will
show up a single time in one table but many times in the
related table.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
56
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Open the database, and establish a relationship between
the Books table and the Orders table using the drag-and-
drop method.
Establish a relationship between the Customers table
and the Orders table using the Edit
Relationships command on the Ribbon.
Edit an established relationship by double-clicking the
link.
Explore the options and settings in the Edit
Relationships dialog box.
Move the tables around in the relationship map.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
57
Access 2007:
Entering and Editing Data in Tables
INTRODUCTION
ADDING AND EDITING DATA IN TABLES
Adding records to tables
To add records in the new record row
To add records with the New Record navigation button
To add records with the New Record command
EDITING RECORDS IN TABLES
To edit a record directly
To edit a record using Find and Replace
To copy and paste a pecord
To delete a record
DATA VALIDATION
Data types and validation rules
To set data validation rules
Validation text
Using field properties to ensure data integrity
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
58
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
59
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
60
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
61
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
62
To delete a record:
Select the record you want to delete, then right-click and
select Delete Record.
A dialog box appears, telling you the action cannot be
undone and asking if you are sure you want to delete the
record.
There may be other records that rely on the record you are trying to
delete. DO NOT delete a record without knowing how it will impact
the rest of your database.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
63
Data validation
Data validation is an important database concept. It is the
process by which Access tests the data that is being entered
into the database to make sure it is in an acceptableor valid
format.
Let's say one of your database users has entered an order date
of January 4, 2008, in the month/date/year format as
01/04/2008. Another user has entered an order placed on that
same date in the day/month/year format as 04/01/2008. If the
database is tracking all sales for the month of January 2008, it
may not show both orders as placed in January, even though
both were placed on the same date.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
64
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
65
Validation text
Validation text is a specialized error message you can set to
have Access tell the user entering data the specific way you
want that person to enter it.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
66
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
67
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Open the database, and add records using the New
Record navigation button.
Add a record using the New Record command in the
Ribbon.
Edit a record using the Find and Replace command.
Copy and paste a record in one of the tables.
Set a validation rule and validation text for a field in one
of your tables, then break the rule when entering data to
read the resulting message.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
68
Access 2007:
Creating and Using Forms
INTRODUCTION
CREATING AND USING FORMS
Why use forms?
CREATING A FORM
To create a form using the Form command
USING FORMS TO ENTER DATA
To add a record using a form
To edit records using a form
CREATING A DROP-DOWN LIST
To create a drop-down list using a Combo Box control
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
69
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
70
Creating a form
Access 2007 has several automatic tools for creating forms.
These tools are located in the Forms group on the Create tab
in the Ribbon, as seen below:
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
71
The newly created form has the same name as the source
table by default. You can give the form a new name by
saving the form. You will be prompted to give the form a
name.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
72
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
73
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
74
Drag and drop the combo box sizing tool to create the
combo box where you want it to be on the form.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
75
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
76
Switch to Form view to see how the combo box works. The
Category drop-down list appears on the Books form, as seen in
the image below.
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Scroll through the customer records using
the Customers form.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
77
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
78
Access 2007:
Making Forms More Usable with
Controls
INTRODUCTION
MAKING FORMS MORE USABLE
Making forms more useable
SETTING FORM PROPERTIES
To set form properties
HIDING FIELDS ON A FORM
To hide a field on a form
CREATING COMBO BOXES
SETTING FIELD PROPERTIES
To set field properties from a form in Design view
To set a field to auto-fill with the current date
CREATING COMMAND BUTTONS
To add a command button to a form
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
79
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
80
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
81
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
82
Tip: Use the tabs to find the specific property you want to
set. Use the help available to you in the bottom-left corner of
the Access window to know what each property setting does.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
83
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
84
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
85
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
86
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
87
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
88
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
89
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
90
o Click Finish.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
91
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Open the Orders Form, and change the form properties
so it limits users to adding records only.
Hide the Order ID and Order Date fields.
Set the Order Date field property to have a Default
Value of the current date.
Create drop-down lists for the Customer ID and Book
ID fields, making sure they contain helpful information for
users and correctly populate the database with ID
numbers.
Add a command button to the form.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
92
Access 2007:
Making Forms Attractive
INTRODUCTION
MAKING FORMS MORE ATTRACTIVE
Making forms more attractive
To switch to Layout view
ADDING A LOGO
To replace the icon with a logo
APPLYING A STYLE WITH AUTOFORMAT
To apply an AutoFormat
WORKING WITH TITLES
To change the form title
CHANGING TEXT ON THE FORM
To modify text
WORKING WITH OBJECTS ON A FORM
To move objects on a form
To resize objects on a form
To apply a border to objects on a form
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
93
In Layout view, you see the form as it will appear to the user in
Form view, so it's useful for setting the size of controls and
other objects on the form, as well as for changing the font,
colors, and borders on the form.
Adding a logo
Access 2007 automatically puts a form icon, like the one below,
in the header area of every form you create.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
94
You can move and resize the logo as well. Moving and
resizing objects on a form is covered later in this lesson.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
95
To apply an AutoFormat:
Click the AutoFormat command on the Ribbon.
Select the desired format. The change will appear when
the mouse button is released.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
96
When the title highlight appears, type the new title, then
hit the Enter key on your keyboard.
Note: The title does not affect the name of the form, and
vice versa.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
97
To modify text:
Highlight the text.
Apply the desired format by doing one or more of the
following:
o Select the desired font style from the font
face drop-down list.
o Set the size of the text using the font
size selection list.
o Choose a color for the text using the font
color selector.
o Apply either the bold, italics, or underline style.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
98
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
99
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Open the Orders Form in Layout view and change the
form by:
o Adding a picture using the Logo command
o Giving the form a new title
o Modifying some text on the form
o Applying one of the AutoFormat options
o Moving or resizing an object on the form
o Applying a border to an object on the form
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
100
Access 2007:
Sorting Records
INTRODUCTION
SORTING RECORDS
Sorting records
SORTING ON TEXT VALUES
To sort based on a text value
SORTING ON NUMERICAL VALUES
To sort based on a numerical value
To clear a sort
CHALLENGE!
Introduction
Sorting records
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
101
Sorting records
Sorting is probably the simplest way to look at data because it
keeps similar things together. In our bookstore database, for
example, we could sort our data a few ways:
Sort
Option Also Called Description
Values closest to A are
A to Z Ascending displayed first
Values closest to Z are
Z to A Descending displayed first
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
102
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
103
Also
Sort Option Called Description
Smallest to Values closest to 1 are
Largest Ascending displayed first
Largest to Descendin Values farthest from 1 are
Smallest g displayed first
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
104
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
105
To clear a sort:
o Click the Clear Sort command in the Sort &
Filter group on the Ribbon.
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Open the Customers table and the Books table.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
106
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
107
Access 2007:
Filtering Records
INTRODUCTION
FILTERING RECORDS
Filtering records
FILTERING BY FIELD
To use the Filter by Field feature
To toggle between filtered and unfiltered results
FILTERING BY SELECTION
To use the Filter by Selection feature
SORTING OR FILTERING THE FILTERED RESULTS
USING ADVANCED FILTERS
To apply an Advanced Filter
To save the Advanced Filter
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
108
Filtering records
Watch the video! (7:10min)
Download the example to work along with the video.
Filtering records
When you tell Access 2007 to filter your records, you are asking
it to:
Method Description
Lists all of the values that have been
entered in a specified field so you can
choose which value or values you want
Filter by Field Access to find
Filter by Offers the ability to search records based
Selection on the value that is currently selected in
a table; you can ask it to find records
that:
Equal the value
Do not equal the value
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
109
Filtering by field
When you Filter by Field, Access 2007 finds all of the values
that have been entered in the specified field. Access lists all of
these values for you so you can choose which value or values
you want Access to find for you within that field. Once you
choose which value to filter by, Access returns the results to
you as a subset of records in the table.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
110
When the dialog box appears, select the value you want
to use as the filter value:
o Checking Select All will return every record in the
table. However, clicking this option when all values are
checked will clear the selections.
o Checking Blank will find only records in which the
field is empty.
o Check as many of the values as you want to see
returned in your results.
Click OK.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
111
The results will appear in the table. In the example above, the
results are showing all records for customers living in North
Carolina (NC). Notice that all other records are hidden from
view but that the table name is still Customers.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
112
Filtering by selection
When you Filter by Selection, Access 2007 returns the results
to you as a subset of records in the table. It assumes that your
current selection is what you want to use as your filter value, or
criteria.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
113
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
114
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
115
Your filtered results will appear in a new table. You can save the
advanced filter so you can run it again later if you want.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
116
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Use the Filter by Field method to filter
the Customers table to find all customers from NC.
Use the Filter by Selection method to filter
the Customers table, looking for all NC customers NOT in
Raleigh.
Hint: Use the Does Not Equal option.
Practice toggling between the filtered results and the
unfiltered tables.
Apply an Advanced Filter on the Books table to find all
of the Kids books, sorted by price with the highest price
first.
Save your Advanced Filter with whatever name you
choose.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
117
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
118
Access 2007:
Using Queries to Make Data
Meaningful - Part 1
INTRODUCTION
USING QUERIES: PART 1
Using queries
PLANNING A QUERY
Planning: Which customers ordered technology books?
USING THE QUERY DESIGN COMMAND
To build a query using the Query Design command
HIDING FIELDS OR OTHER INFORMATION IN THE RESULTS
To hide part of the query result
SAVING THE QUERY
To save a query
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
119
results in their own table, which you can then further analyze
and manipulate. In this lesson, we'll explain how to plan a
query using a three-question planning process. You'll also learn
how to use the Query Design command to run a query, as
well as how to modify the query to hide fields or other
information in your query results. Finally, you'll learn how
to save the query for later use.
Using queries
Queries retrieve information from one or more tables based on
a set of search conditions you set up and then combine that
information in a way that's easy for you to analyze. If you've
used an Advanced Filter in Access 2007, then you've already
run a basic query on only one table. If you want to pull data
from more than one table, though, you'll need to use either
the Query Design command or the Query Wizard.
Before using the Access 2007 query tools, it's important to plan
out the query using a logical process. Otherwise, you may not
get the results you expect.
Planning a query
There are three questions you need to answer when planning a
query:
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
120
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
121
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
122
Drag and drop the fields you want to see in your results
to the bottom portion of the query design screen.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
123
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
124
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
125
When you run your results, the field you chose will be
hidden, as seen below.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
126
Sometimes you will not need to save your results or your query
design, and other times you may want to keep it to run again
later or to modify it slightly. Saving a query is easy to do.
To save a query:
Right-click the Query tab.
When the Save As dialog box opens, give your query a
meaningful name.
Click OK.
The query will now be listed in the object list on the left
side of the Access window.
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Plan a query to find out which customers order a certain
category of books.
Use the Query Design command to set up the query.
Run the query, and view your results.
Save the query.
Modify the query to hide a field.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
127
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
128
Access 2007:
Using Queries to Make Data
Meaningful - Part 2
INTRODUCTION
USING QUERIES: PART 2
USING TOTALS IN A QUERY
USING COUNT AND GROUP BY FUNCTIONS IN A QUERY
To use the Count and Group By options in a query
SORTING AND FILTERING QUERY RESULTS
To sort via the query design
To filter via the query design
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
129
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
130
Notice that we get a record back for every order of each book
that has been ordered.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
131
Click in the Totals row for the field you want to count. We
want to count the number of times the same Book
ID appears in the Orders table.
From the list of optional Totals functions, select Count.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
132
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
133
Challenge!
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
134
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
135
Access 2007:
Using Reports to Make Data
Meaningful to Others
INTRODUCTION
USING REPORTS TO MAKE DATA MEANINGFUL TO OTHERS
CREATING A REPORT BASED ON A TABLE
To create a report based on a table using the Report command
CREATING A REPORT BASED ON A QUERY
To limit the number of records in a report
GROUPING ITEMS ON A REPORT
To add grouping to a report
FORMATTING A REPORT IN LAYOUT VIEW
To delete a column or other report element
To move a column or other report element
To resize a column or other report element
To add a logo to the report
To modify the title of a report
To modify text in report headings
To apply an AutoFormat style
To change the page layout
To change the page layout options
SAVING A REPORT
To save a report
CHALLENGE!
Introduction
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
136
Access 2007 offers tools that allow you to create and format a
report. The Report Wizard walks you through the steps of
creating a report. The Report command, however, is much
easier to use, and all of the formatting options are still available
to you in Layout view once the report is created. With these
tools, you can create a report based on a table or query.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
137
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
138
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
139
Click Run! to make sure the query results look like you
want the report to look.
Create the report using the Report command on
the Create tab.
Format the report as desired.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
140
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
141
When you release the mouse button, the report will now
appear with items grouped. Our report is grouped
on Category now, as seen below.
The Group, Sort, and Total dialog box will remain open
until you close it.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
142
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
143
Click OK.
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
144
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
145
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
146
Select the layout option you want to alter from the Page
Layout command group on the Ribbon.
Page Layout
Option Description
To set the margins for narrow,
Margins wide, or normal
To select either
a portrait or landscape orienta
Orientation tion
Size To set paper size
Saving a report
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
147
When you have created and modified a report and try to close
it, Access 2007 will prompt you to name and save the report. If
you do not need this report again, you do not need to save it.
However, if you think you may want to publish it again, it is
best to save.
To save a report:
Right-click the Report tab.
Choose Save from the list that appears.
When the Save As dialog box opens, give the report a
name.
Click OK.
Challenge!
If you haven't already done so, save the sample Ready2Read
database to your computer.
Create a report based on a table.
Create a report based on query.
Modify the layout of a report by:
o Resizing or moving columns
o Deleting report elements
o Giving the report a new title
o Applying an AutoFormat style to the report
o Using groups, sorts, or totals in a report
/var/www/apps/conversion/tmp/scratch_3/350338943.docx
148
/var/www/apps/conversion/tmp/scratch_3/350338943.docx