Académique Documents
Professionnel Documents
Culture Documents
Module 2
http://pds.hccfl.edu/pds
Microsoft Access 2007:
Module 2
August 2007
Table of Contents
Objectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Import a Table from Excel. . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Export an Access Table to Excel. . . . . . . . . . . . . . . . . . . . . . . 5
Create a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Query
Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Show. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Text Data Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Wildcards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Field Not in Result. . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Number. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Comparison And. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Comparison Or. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Aggregate Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Avg (Average). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Parameters and the Between Operator. . . . . . . . . . . . . . . . . 21
Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Modify a Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Insert Images into a Form or Report. . . . . . . . . . . . . . . . . . . 26
Resize Images in a Form or Report. . . . . . . . . . . . . . . . . . . . 27
i
Microsoft Access 2007 - Module II
Objectives
At the end of this training session you will be able to:
1. Import a table from Excel;
2. Export an Access table to Excel;
3. Create a query;
4. Sort fields in a query;
5. Show fields in a query;
6. Run a query using wildcards;
7. Run a query for fields not in result;
8. Run a query for a number value;
9. Run a query using the comparison criteria “And”;
10. Run a query using the comparison criteria “Or”;
11. Understand the purpose of Aggregate Functions;
12. Create and run a query using count;
13. Create and run a query using average;
14. Create and run a query using the parameter between;
15. Insert and resize a graphic/image;
16. Create and Modify a Report.
Hillsborough Community College - Professional Development and Web Services
Microsoft Access 2007 - Module II
Hillsborough Community College - Professional Development and Web Services
11
13
12
Microsoft Access 2007 - Module II
2
variety of formats. In this example, we are
going to export to Excel.
7
preview the exported file.
6. Click on OK.
7. If you elected to Open the destination file
after the export operation is complete, Excel
will open with the new exported file displayed.
8. Save the export steps, if this is a regularly
occurring export and click Close.
Hillsborough Community College - Professional Development and Web Services
Create a Query
A query allows for table inquiries. A query
can change, delete, add, and arrange 1
data in tables. Queries also aid gathering
information for forms and reports. With 2
a query you can ask questions and set
parameters.
e.g. tblEmpInfo.
6
Microsoft Access 2007 - Module II
10
11
12
Hillsborough Community College - Professional Development and Web Services
Microsoft Access 2007 - Module II
1
check to each field name’s Show checkbox.
To hide fields in a query’s results, remove
the check in the field name’s Show
checkbox.
Hillsborough Community College - Professional Development and Web Services
Activity
Run a query looking for employees who live in
Temple Terrace. How many HCC employees live in
Temple Terrace?
10
Microsoft Access 2007 - Module II
Activity
Run a query looking for employees working at a cam-
pus with the letter D. How many employees work at a
campus with the letter D?
11
Hillsborough Community College - Professional Development and Web Services
12
Microsoft Access 2007 - Module II
Activity
Run a query looking for employees earning $60,000.
How many employees are earning $60,000?
13
Hillsborough Community College - Professional Development and Web Services
Activity
Run a query looking for employees earning less than
$30000. How many employees are earning less than
$30,000?
14
Microsoft Access 2007 - Module II
4
line, each one must be true.
Activity
Run a query looking for employees working at the
Ybor campus and who are exempt. How many em-
ployees are working at the Ybor campus and are
exempt?
15
Hillsborough Community College - Professional Development and Web Services
Query Criteria:
Comparison OR
Using the OR criteria is applicable when in- 2 1
formation is needed from multiple fields.
Activity
Run a query looking for employees working at the
Ybor (YB) campus or the Plant City (PC) campus.
16
Microsoft Access 2007 - Module II
Aggregate Functions
Aggregate functions within Access allows
the user to carry out simple mathematical
operations within a query. Aggregate
functions (operations) include sum,
average, minimum, maximum, count,
standard deviation and variance. These
functions can be accessed by selecting the
Totals button on the query design toolbar
or typing the aggregate function in the Total
row of the Design grid.
17
Hillsborough Community College - Professional Development and Web Services
18
Microsoft Access 2007 - Module II
8
Activity
Create a query for gender using the aggregate func-
tion Count. Save the query as qryCntGender
19
Hillsborough Community College - Professional Development and Web Services
Activity
Create a query for the average salary by city using the
aggregate function Avg. Save the query as 7
qryAvgSalaryCity.
20
Microsoft Access 2007 - Module II
21
Hillsborough Community College - Professional Development and Web Services
Activity
Create a query using parameters. The query will show
the names of people, salary and campus. Save the
query as qryBtwSalaryCampus.
22
Microsoft Access 2007 - Module II
23
Hillsborough Community College - Professional Development and Web Services
9 7
24
Microsoft Access 2007 - Module II
Modify a Report
Design View and Layout View allow for
the modification and customizing of reports
by adding a logo or picture, organizing
headers, footers, and sorting columns.
3
To move report objects around, click on an
object and drag it to the new location, while
you are in Design View or Layout View.
You can also resize and delete columns.
Activity
Modify rptEmployeeInfo by changing the font, size
and color. Change the report header title to HCC
Employee Information. Delete unnecessary columns
to save space.
25
Hillsborough Community College - Professional Development and Web Services
1
Insert a Graphic/Image
Personalize forms and reports by adding a
company logo or another graphic. To insert
a graphic into a form or report, you can be
in Design View or Layout View. In this
example, we’ll use Design View. 2
1. In the Report Design Tools/Design
tab>Control group, click Image.
2. Take the image pointer and click and hold, then 3
draw a rectangle to the approximate size of the
graphic in the location where the image will
appear. Release mouse button after the Image
box is drawn.
In this example, the HCC logo is added to the
report header.
3. After the Insert Picture dialog box appears,
locate the file and click on OK.
e.g. Desktop > PDWS Folder > Access II>
HCCLogo. 4
4. Resize graphic with sizing handles.
26
Microsoft Access 2007 - Module II
Resize Image/Graphic
Sometimes after an image is placed on a
form or report, it does not fit properly in its
box. Below are the steps to resize an image 1
without resizing the box entirely.
Activity
Insert an image into your report and resize the image
using the Resize Image/Graphic steps.
5
27
Hillsborough Community College - Professional Development and Web Services
28