Download Microsoft Office Access 2007 (or Access) is known as a

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Entity–attribute–value model wikipedia , lookup

Clusterpoint wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Object-relational impedance mismatch wikipedia , lookup

Relational model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Database model wikipedia , lookup

Transcript
ICT II
Microsoft Office Access 2007
Northwest Rankin Middle School
Table of Contents
The Microsoft Access 2007 Program ......................................................................................................................3
Access Activity 1.1 – Identify Parts of the Access Program Window .....................................................................3
Working with Records ................................................................................................................................................... 4
Navigating Records in Datasheet View .......................................................................................................................... 5
Editing Records .............................................................................................................................................................. 5
Selecting Records and Fields ......................................................................................................................................... 5
Working with Data ......................................................................................................................................................... 6
Changing Datasheet Layout ........................................................................................................................................... 6
Saving and Printing a Datasheet .................................................................................................................................... 6
Compacting and Repairing a Database .......................................................................................................................... 6
Access Activity 1.2 – Work in an Existing Database ...............................................................................................7
Lesson 1 Step-by-step .................................................................................................................................................... 7
Creating a Database ............................................................................................................................................ 10
Designing a Table................................................................................................................................................. 10
Entering Field Names in Datasheet View .................................................................................................................... 10
Working in Design View....................................................................................................................................... 11
Adding, Deleting, Renaming, and Rearranging Fields in Design View ......................................................................... 12
Description .................................................................................................................................................................. 13
Changing Field Properties in Design View ................................................................................................................... 13
Access Activity 2.1 – Creating a Database ........................................................................................................... 14
Lesson 2 Step-by-step .................................................................................................................................................. 14
Creating a Form ................................................................................................................................................... 18
Understanding Controls .............................................................................................................................................. 19
Modifying a Form Design ............................................................................................................................................. 19
Working in Form View ................................................................................................................................................. 20
Access Activity 3.1 – Creating a Form.................................................................................................................. 20
Lesson 3 Step-by-step .................................................................................................................................................. 20
Understanding Queries ....................................................................................................................................... 23
Creating a Query in Design View ......................................................................................................................... 23
Moving and Sorting Fields in Design View ................................................................................................................... 24
Adding Conditions/Criteria to a Field .......................................................................................................................... 24
Using Operators in a Condition ................................................................................................................................... 25
Access Activity 4.1 – Designing a Query .............................................................................................................. 26
Lesson 4 Step-by-step .................................................................................................................................................. 26
Creating Reports .................................................................................................................................................. 29
Modifying a Report Design .......................................................................................................................................... 30
Sharing Designed Reports ........................................................................................................................................... 30
Access Activity 5.1 – Creating a Report ............................................................................................................... 30
Lesson 5 Step-by-step .................................................................................................................................................. 30
ICT II - Access Tutorial
Page 2
Microsoft Access 2007
Tutorial
– Lesson 1
The Microsoft Access 2007 Program
Microsoft Office Access 2007 (or Access) is known as a computerized database management system
(DBMS). A database management system allows you to store, retrieve, analyze and print information.
A low-tech version of a DBMS would be a set of file folders. A computerized DBMS is much faster,
more flexible, and more accurate than using file folders. A computerized DBMS, such as Access, can
allow the user to search through and sort thousands of pieces of data quickly and easily, saving time
and effort.
Databases are everywhere! When you search through a music playlist or complete an item lookup
through an online store such as Amazon.com, you are retrieving information using a computerized
database management system, or DBMS.
A database is a collection of objects that work together to store, retrieve, display and summarize data.
The object types you will learn about in this tutorial are tables, queries, forms, and reports. An Access
database also includes objects called macros and modules, but we will not be dealing with those in this
tutorial.
 A table stores all of the data in the database in a format called a datasheet. A database usually
contains many tables.
 A datasheet is similar in appearance to an Excel worksheet, containing rows and columns.
 A query is used to search for specific data in one or more tables. Basically, a query is a question
you ask the database.
 A form displays data from one or more tables or queries in a format similar in appearance to a
paper form. You can also enter additional data into tables using a form. Because Access forms
resemble familiar paper forms, they are a user-friendly way for individuals without technical
knowledge of databases to access shared data.
 A report displays data from one or more tables or queries in a format intended for on-screen
viewing or printing. A report is often used to summarize selected data.
Access 2007 has the same basic parts as all Office 2007 programs, such as the title bar, the Quick
Access Toolbar, the Office Button, the Ribbon, and the Status Bar. In addition, at the left side of the
Access window is the Navigation Pane, which displays the objects contained in the database.
An object opened from the Navigation Pane is displayed as a window in the main area of the Access
screen. You may have multiple objects (multiple windows) open on the screen at one time; a tab at
the top of each window identifies the object type and name. Move between one open object and
another by clicking on the tab of the object you want displayed.
To see more of an open object, you may close the Navigation Pane by clicking the Shutter Bar
Open/Close Button on the left side of the screen.
Access Activity 1.1 – Identify Parts of the Access Program Window
On the following page is a screen shot of the Access program window, showing the Navigation Pane
and a few open objects. Use this information to complete the Access Program Window Worksheet. It
is important that you be able to identify the basic parts of the Access window, as they will be
referenced in many of the activities you will complete in this unit.
ICT II - Excel Tutorial
Page 3
Access 2007 program window
Working with Records
When working with databases, it is essential that you understand some terms regarding organization
of data in a table.
 A record is a complete set of data. For example, all of the information about a particular song (title,
artist, album, genre, etc.) would be one record. In tables, a record appears as one row.
One
record
Title
Artist
Album
Genre
Can’t Buy Me Love
The Beatles
A Hard Day’s Night
60’s Rock
Jump
Van Halen
1984
80’s Rock
 A record is made up of one or more fields (“Title”, “Artist”, “Album, “Genre”). Fields appear as columns.
 A field is identified by its field name, which is displayed at the top of the column.
 The value entered into a field is called a field value. In the sample above, the highlighted record has
Van Halen as the field value in the Artist field.
One field: “Artist”
Title
Artist
Album
Genre
Can’t Buy Me Love
The Beatles
A Hard Day’s Night
60’s Rock
Jump
Van Halen
1984
80’s Rock
ICT II - Access Tutorial
Page 4
Navigating Records in Datasheet View
The techniques used to move around within a datasheet and enter or edit data should be familiar to
you, as they are similar to the techniques used in an Excel worksheet.
Enter, Tab and arrow keys

Next field in current record: <Enter>, <Tab>, or right arrow

Previous field in current record: <Shift> + <Tab>, or left arrow

Move up a record (same field): up arrow

Move down a record (same field): down arrow
To make locating records easier, Access includes a record navigation bar at the bottom of the
datasheet. The illustration below identifies the functions of the buttons on the record navigation bar.
First record button
Previous record button
Current record box
New (blank) record button
Last record button
Next record button
Editing Records
 When a field is completely selected, you can replace the contents by typing in a new value.
 To edit, but not completely replace data, click in the field – make changes at the insertion point, as
with any text.
 If you make a mistake or change your mind, use the Undo button or the <ESC> key to restore the
original data in the field. You can only undo changes to the current field.
Some fields are designed to accept only certain types of data, such as a Zip Code. If you try to enter an
improper field value (one that that does not match the designated data type), an error message
appears and tells you what to do to correct the mistake.
Selecting Records and Fields
You can quickly select entire records and fields by clicking a record or field selector.
 A field selector contains the field name and is located at the top of each column. When you click
the field selector, the entire field (column) is selected.
 A record selector appears to the left of each record. When you click on the record selector, the
entire record (row) is selected.
Field selector for field “Artist”
Record
selector
for 2nd
record
Title
Artist
Album
Genre
Can’t Buy Me Love
The Beatles
A Hard Day’s Night
60’s Rock
Jump
Van Halen
1984
80’s Rock
ICT II - Access Tutorial
Page 5
Working with Data
 You can delete, cut, copy, and paste data or entire records.

Deleting a record is permanent, and cannot be undone!

Be careful when pasting entire records:

Normal paste could overwrite another record.

Use “Paste Append” – located by clicking the arrow at the bottom of the Paste button in
the Clipboard Group.
Changing Datasheet Layout
Like with an Excel worksheet, you can change the layout of an Access datasheet, such as row height and
column widths.
 All rows must always be the same height:

You may adjust a row height, but this will change all rows.

Point to the bottom of a record selector, and drag the double-headed arrow to change row height.
 You may also specify a row height.
 Column widths can be different, and can be easily changed:

Point to the right edge of field selector; drag the double-headed arrow to change column width.
 Double-click on the right edge of the selector to allow Access to determine the “best fit” for the data.
 You can rearrange the order of columns in the datasheet:

Click the field selector to select the entire column.

Drag and drop the column to the desired location.
 A black vertical line shows where the column will be inserted.
Saving and Printing a Datasheet
 You should always Print Preview before printing – adjust page layout as necessary for the data to
fit on the page as desired.
 Access automatically saves all data changes for you!

If you have only edited or added data, you do not need to save.
 Any format changes to the table are NOT automatically saved.

If you have made format / layout changes, you must save to preserve those changes.
Compacting and Repairing a Database
 Due to adding and editing data in the database, it can become fragmented or sometimes corrupted.
 This can slow the performance of the database, or even result in error messages.
 Compacting a database rearranges the data to optimize your database performance:

Run the “Compact and Repair” utility (Office Button -> Manage).
ICT II - Access Tutorial
Page 6
Access Activity 1.2 – Work in an Existing Database
OK – Let’s try it!!
One advantage of using an electronic DBMS is the ability to store, edit, retrieve, analyze, and print data
quickly and easily. You can open an existing database simply by navigating to the location where it is stored.
Lesson 1 Step-by-step
The following activity illustrates how to complete basic tasks within an existing Access database.
This database holds data about past Super Bowl participants and winners.
1. Navigate to Template drive -> ICT II 09-10 -> Unit 4: Database Access (or other data file location
specified by your instructor). Right-click -> Copy the database file SuperBowl.accdb data file (you
might not see the .accdb extension after the file name; in that case, copy SuperBowl.)
2. Then, navigate to the Access folder in your H: drive, and paste the file.
3. Open Microsoft Office Access 2007, if you have not already done so. Click the More command in the
Open Recent Database pane of the Getting Started with Microsoft Office Access page. The Open
dialog box appears.
4. Open the SuperBowl.accdb data file from the Access folder in your H: drive (that you pasted in step
2 above). Access opens the database, and the Navigation Pane displays the objects in the database.
 Remember that the Save As command lets you save a file with a new name and/or to a new
location, leaving the original file unchanged. You are going to save this database with a new
name to see how this works with Access databases. The case of saving a database is a bit
different – read and follow the instructions below carefully!
5. Click on the Office Button, point to Save As, and then choose Access 2007 Database. (If you
click on Save As instead of specifying Save As Access 2007 Database, you will be prompted to
save only one object in the database, not the entire database!) The Save As dialog box
appears.
6. Change the save location (if needed) to the Access folder in your student directory (H: drive).
7. In the file name box, change the file name to SuperBowl_xx (replace xx with your login name).
8. Click Save.
Remember: you only need to save formatting, NOT data, changes.
9. If the Security Warning opens, click Options on the Security Warning, and choose Enable this
content, then click OK.
10. In the Navigation Pane, double-click SUPER BOWL STATS. The table opens in Datasheet view.
 If your objects do not open with a tab at the top of the object window, you can change your
Access options: Office Button -> Access Options (at the very bottom right) -> Current Database
(from the left-hand menu) -> select Tabbed Documents from the Document Window Options
area. Make sure the Display Document Tabs box is also checked. Click OK.
11. In the Navigation Pane, double-click GAME AND WINNER from the Queries list. The query
opens in Query Datasheet view.
12. In the Navigation Pane, double-click FORM: SUPER BOWL STATS. The form opens in Form view.
13. In the Navigation Pane, double-click REPORT: SUPER BOWL STATS. The report opens in Report
view.
ICT II - Access Tutorial
Page 7
 Notice the different icons for the different object types next to the object names in the window
tabs for each open object.
14. Click the Shutter Bar Open/Close Button at the top of the Navigation Pane. The Navigation Pane
closes.
15. Click on the tab for the table SUPER BOWL STATS.
16. On your keyboard, press in turn each of the following: Enter, Tab, Page Up, Page Down, Home,
Ctrl+Home, Ctrl+End, and directional arrow keys, noticing how the active field shifts in each instance.
 Remember, you can also navigate and select records using the record navigation bar at the
bottom of the datasheet.
17. Click the Last record button on the record navigation bar to move to the last record in the table.
18. Press the left or right arrow key to move across the fields in the last record until the American
Score field is selected. Change the field value to 29.
19. Click the First Record button on the record navigation bar to move to the first record in the table.
20. Click the Next Record button to move to the next record.
21. Click in the Current Record box, select 2, and then type 7. Press the Enter key. Record 7 becomes
the current record.
22. Click the National Score field value (shows a field value of 7) for record 7. Press the Tab key to
move to the Winner field. The field value Washington in the Winner field is selected.
23. Type Miami to replace the current field value with the corrected data.
24. Press the Tab key 3 times. The Date field for record 8 should be selected.
25. Click the insertion point to the right of the second “3” in the field value 1/13/1973, and press
the Backspace key. Correct the date by typing 4 in place of the 3 you have just deleted.
26. Click on the New Record button. Enter the data for the 2008 Super Bowl game as shown below:
Game: XLII
Date: 2/3/2008
National Team: N.Y. Giants
American Team: New England
National Score: 17
American Score: 14
Winner League: National
Winner: N.Y. Giants
 Remember that editing changes made to data do not have to be saved – if we closed our table
now, our changes would be automatically saved.
27. Click the American Team field selector to select the entire column.
28. Press and hold down the Shift key, click the National Score field selector, and release the Shift
key. Four columns are selected.
29. Click the Game field selector. The Game field is selected, and the other four columns are deselected.
30. Click the record selector for the sixth record. The entire record for Game VI is selected.
31. In the Clipboard group on the Home tab, click the Copy button.
32. In the Clipboard group on the Home tab, click the arrow at the bottom of the Paste button (not
on the Paste button itself!). Click Paste Append. A copy of the record for Game VI is pasted at
the bottom of the datasheet.
ICT II - Access Tutorial
Page 8
33. Click on the record selector for the last record (the one you just pasted). Press the Delete key
on your keyboard.
34. A dialog box opens and warns you that you are about to delete one record.
Click Yes; the record is deleted.
 You can change the row height by dragging the bottom edge of a row up or down, as you do in
an Excel worksheet. You can also specify an exact row height. In the Records group on the Home
tab, click on the More button, and then select Row Height.
35. Point to the bottom border of the record selector for any record. When the pointer changes to
a double-headed arrow, drag the border down until it appears on top of the bottom border of
the record selector of the record below.
36. When you release the mouse button, the row change (approximately double in original height),
affects all rows in the table.
37. In the Records group on the Home tab, click the More button, and then select Row Height. The
Row Height dialog box opens.
38. We could specify a numeric value for our row height. This time, however, we are going to restore
the row heights to their standard height by checking the Standard Height option. Click OK.
39. Point to the right border of the Winner League field (second to last field) selector so the
pointer changes to a double-headed arrow.
40. Drag the right edge of the Winner League field selector until the entire field name is visible.
41. Point to the right edge of the Game field selector so the pointer changes to a double-headed
arrow, then double-click. The column is resized to “best fit”.
42. Click on the Winner League field selector.
43. Click, hold, and drag the Winner League field selector to the right until the black vertical line
appears at the right edge of the datasheet (to the right of the Winner field), and release the
mouse. The column is moved to be the last column in the datasheet.
 Remember that, while all data changes are saved automatically, any formatting changes must be
manually saved to maintain the changes.
44. On the Quick Access Toolbar, click on the Save button to save your formatting changes to the
table.
45. Click on the Close button on the SUPER BOWL STATS table window. The table closes.
46. Click on the Close button on the GAME AND WINNER query window. The query closes.
47. Click on the Close button on the FORM: SUPER BOWL STATS form window. The form closes.
48. Click on the Close button on the REPORT: SUPER BOWL STATS report window. The report closes.
49. Click on the Office Button. Point to Manage, and then choose Compact and Repair Database.
Depending on the size of a database, this process could take only a second or up to a couple of
minutes.
50. Click the Office Button again, and then choose Close Database. The database closes.
51. On the Access title bar, click the Close button. Access closes.
ICT II - Access Tutorial
Page 9
Microsoft Access 2007
Tutorial
– Lesson 2
Creating a Database
The first step in creating a database is to create the database file that will store the database objects.
Access provides template databases containing predesigned objects that are useful for organizing data
for different purposes. Another option is to use the Blank Database template, which creates a
database with no objects in it.
When you create a new blank database, Access automatically opens a blank table in datasheet view so
that you can design and enter data in the table. Access provides a default name (Table1) for the table,
which you can change when you save the table for the first time.
Designing a Table
The default table created in a blank database contains one field, named ID. Access sets this ID field as the
table’s primary key. A primary key is the field that contains a unique field value for each record in the
table. In some tables, this field is called an AutoNumber because it automatically adds a unique number
for each new record in the table. The Autonumber field will show the placeholder (New) until you create
the record by adding a value to one of the record’s fields. Access will then change (New) to a unique
number.
You can set your own primary key in any field containing a unique identifier for each record. For
example, in a table storing student data, each student’s MSIS, or lunch, number would be unique;
therefore, it could serve as a primary key. Access will not allow you to enter a duplicate value in the field
identified as the primary key. A table has only one primary key.
Entering Field Names in Datasheet View
To enter a field name directly in Datasheet view, simply double-click the “Add New Field” field selector
and type the name that you want to use for the field. The field name is added to the field selector
when you press the Tab key. You can continue entering field names in this manner until you have
entered all of the fields that you plan to use in your table. The last column will always contain the “Add
New Field” field selector in case you need to add another new field later.
A field’s data type determines the type of data that you can enter into a field, such as numbers or text,
or alphanumeric (a combination of numbers and text) data. As you enter field values into a new table
for the first time, Access will automatically assign a data type for each field based on the field values
you enter.
You can also specify the data type you want for a particular field yourself. One quick and simple way to
do this is using the Table Tools Datasheet tab on the Ribbon. The Table Tools Datasheet tab allows
you to insert, delete, and modify fields in your table.
Data Type
arrow
Date field
is selected
Date/Time in the Data Type box
ICT II - Access Tutorial
Page 10
To change the data type for a field, first click on the field selector for that field to make it active. Click
the Data Type arrow in the Data Type & Formatting group on the Table Tools Datasheet tab, and
select the desired data type.
The table below describes the different data types that you can use in Access.
Format
Description
Text
Accepts field values containing letters, numbers, spaces, and certain symbols,
such as underscore (_); can store up to 255 characters; often used to store data
such as names and addresses.
Memo
Like the Text data type, accepts fields containing alphanumeric data, but can
store field values containing up to 65,535 characters; often used to store long
passages of text, such as detailed notes about a person or product.
Number
Stores numbers. Numbers fields are usually values that will be used in
calculations, such as multiplying the cost of an item by the number of items
ordered to get a total. Sometimes Number fields are used to restrict the user to
entering field values containing only numbers.
Date/Time
Stores dates, times, or a combination of both.
Currency
Accepts monetary values and displays them with a dollar sign and decimal
point.
AutoNumber
Adds a unique numeric field value to each record in a table; often used for
primary key fields.
Yes/No
Stores Yes/No, True/False, or On/Off values.
OLE Object
Attachment
Stores graphics, sound, and objects such as spreadsheets in a field; can be
embedded or linked.
Stores a value that contains a hyperlink. Clicking the value activates the link and
opens a Web page or other location, or addresses a message to an e-mail
address.
Stores graphics, sound, and movie files as attachments.
Lookup Wizard
Creates a field that lets you “look up” a value from another table or from a list.
Hyperlink
Working in Design View
Although you can make basic changes to the properties of a field in Datasheet view, such as its
data type, there are other changes that can only be made in Design view. In Design view, you can
add, delete, and make changes to the way the fields store data. To change to Design view, click
the View button in the Views group on the Table Tools Datasheet tab.
In Design view, the field names and data types appear in the design grid in the top half of the table
window. The bottom half of the window is called the Field Properties pane. The Field Properties pane
displays the properties for the field currently selected in the design grid at the top of the window. The
properties that appear in the Field Properties pane depend on the field’s data type. If the field
currently selected in the design grid, for example, is of the Date/Time data type, only the properties
for a Date/Time field are shown in the Field Properties pane.
ICT II - Access Tutorial
Page 11
Below is an illustration showing a table in Design view:
Primary
key
symbol
Current
field
Design
grid
Field Properties pane
In the illustration above, you can see that the National Score field is the current field selected in the
Design grid. Notice that the field selector for that field is shaded orange. In the Field Properties pane
at the bottom of the window, the properties for this field (with a Number data type) are displayed.
You might also notice that the field selector for the Game field now has a key symbol on it. This
symbol indicates that the field has been changed to the table’s primary key.
Adding, Deleting, Renaming, and Rearranging Fields in Design View
 You can use the options in the Tools group of the Table Tools Design tab to add and delete fields:
 To insert a new field, click on the record selector below where you want the new field to appear
and click on the Insert Rows button.





 To delete a field, select the field you want to delete, and click on the Delete Rows button.
If you want to add a new field to the end of the table, you can simply click in the first empty row in
the design grid, and type the field name.
You can drag fields in the design grid to rearrange the order in which they appear in the table.
To rename a field, edit the field name in the design grid and press the Tab key.
You can edit a field’s data type by clicking in the Data Type box for that field in the design grid. Use
the arrow to the right of the Data Type box to display a list of data types, so you can choose the
data type you want.
You can set the primary key of a field using the Primary key button, also located in the Tools group.
Any changes you make in Design view are automatically updated in Datasheet view when you save the
table.
ICT II - Access Tutorial
Page 12
Description
The Description property in the design grid is an optional field property you can use to describe what
information to enter into the field. It is always best to use descriptive names for fields. However,
sometimes a field name cannot fully communicate what data is intended to be entered in the field. The
description property allows you to type a “reminder” specifying the information to be entered in the
field. This option is especially useful when a table will be shared with users other than the designer of
the table.
In Datasheet view, any descriptions inserted in the Description property of a field will appear in the
status bar of the table window when that field is active.
Changing Field Properties in Design View
When you create fields for a table, each field is given a data type. When you set a field’s data type, the
field is given certain properties that help you define and maintain the data you enter into the field. A
field property describes a field’s contents beyond the field’s basic data type. Sometimes you want to
restrict what type of information can be entered into the field, or specify the format in which it
appears. Sometimes you won’t want or need to change a field’s properties at all. Remember, you can
change specific properties of a field in the Field Property pane. A few of the standard properties are
described below.
 The Field Size property sets the number of characters you can store in a Text, Number, or
Autonumber field. If, for example, we created a field in an address table for the state abbreviation,
we might set the field size to 2 characters, because all state abbreviations contain only two letters.
This would ensure that no one unknowingly entered the full state name, rather than the
abbreviation, in this field.
You need to be careful, when changing a field size property, that you do not decrease it to a size
smaller than the existing data in that field. If you do so, you will lose data.
 The Format property allows you to specify how you want to display numbers, dates, times, and
text. For example, you can choose to display the date as 10/28/2010, or 28-Oct-2010, or Sunday,
October 28, 2010, etc.
Data does not necessarily have to be entered in the format you specify, but will be displayed
that way.
 The Default Value property enters the same value in the field every time a new record is added to
the table. This can save time in entering repetitious field values. If, for example, you created a
table to store the addresses of the parents of all students attending NWRMS, you might enter MS
as a default value in the State field, since most of the parents live in Mississippi.
You may replace the default value to a different value, as needed, when you enter records into
the table.
 The Required property specifies whether a field value must be entered in a particular field. When
you click in the Required box in the Field Properties pane, an arrow appears on the right side of
the box. When you click the arrow, a list containing the values “Yes” and “No” is displayed. For
example, if an employer requires that all employees have their Social Security number on file for
tax purposes, a table of employee data might include the field “Social Security” with a Required
property set to “Yes”.
The Required property for the primary key of a table is always set to “Yes”, because it must
contain a value.
ICT II - Access Tutorial
Page 13
Access Activity 2.1 – Creating a Database
In this activity, you will use the skills introduced in the lesson to create a new database, design a table, and enter
data into a datasheet.
Lesson 2 Step-by-step
The following activity illustrates how to create a new database, design a table, set field properties, and
enter data into a datasheet.
The Nintendo Wii game console revolutionized video game interactivity by making use of a special motion
sensitive controller, becoming a family favorite for gaming.
The datasheet you will design in this activity lists data for some of the top-selling Wii games.
1. Click the Start button -> All Programs -> Microsoft Office 2007 -> Microsoft Office Access 2007,
(or other shortcut location on your computer) to open the Access application.
2. In the New Blank Database section, click the Blank Database template (see the illustration below).
Blank
Database
pane
Blank
Database
template
File name
for the new
database
Browse
button
Create
button
3. In the Blank Database pane (that now appears), click the Browse button (see the illustration
above). The File New Database dialog box opens.
4. Navigate to the Access folder in your H: drive, then click OK. We will change the file name in
the next step.
5. Select the default database name in the File Name text box, and type WiiGames_xx (where xx
is replaced by your computer login name).
6. Click Create. Access creates the WiiGames database and opens it. Access also opens a new,
empty table. Leave this table open for the next step.
 You can always create a new table at any time by clicking the Create tab on the Ribbon, and click
the Table button in the Tables group.
7. On the Quick Access Toolbar, click the Save button. The Save As dialog box opens. The default
name Table1 is selected.
8. In the Table Name text box, type Games. Click OK. The tab for the table now displays the table
name Games. The Games table also appears in the Navigation pane.
ICT II - Access Tutorial
Page 14
9. Double-click the Add New Field field selector in the table. The Add New Field text is replaced
by the insertion point blinking in the field selector.
10. Type Item Number and press the Tab key. The Item Number field is created, and the insertion
point appears in the third column.
11. Type Game Title and press the Tab key.
12. Type Rating and press the Tab key.
13. Type Release Date and press the Tab key.
14. Type Genre and press the Tab key.
15. Type Max Players and press the Tab key.
16. Type Nunchuk? and press the Tab key.
17. Type Retail Price and press and Tab key twice.
 Remember, you can change the data type of any field in the Data Type & Formatting group on
the Table Tools Datasheet tab.
18. Click on the field selector for the Item Number field to make that field active. Click on the Data
Type arrow in the Data Type & Formatting group on the Table Tools Datasheet tab.
19. In the Data Type list, select Number.
20. Press the Tab key three times. The Release Date field should be selected.
21. In the Data Type list, change the data type of the Release Date field to Date/Time. Tab two
times.
22. Change the data type of the Max Players field to Number.
23. Tab once to select the Nunchuk? field. Change the data type of the Nunchuk? field to Yes/No.
Tab once.
24. Change the data type of the Retail Price field to Currency. Click the Save button on the Quick
Access Toolbar (Remember, Access does not automatically save format changes). Your
datasheet should now look like the illustration below.
 We are going to change to Design view in order to further define the properties of the fields we
have created.
25. In the Views group on the Table Tools Datasheet tab, click on the View button (not the arrow
below). The Games table opens in Design view.
26. First, we need to delete the ID field, which was created as the first field in the table by default.
Click the record selector for the ID field to select the field, and click on the Delete Rows button
in the Tools group.
27. Access opens a box warning you that this field is the primary key and asks if you want to
delete the field anyway. Click Yes.
ICT II - Access Tutorial
Page 15
28. We will now specify a new primary key. Select the Item Number field. Click on the Primary Key
button in the Tools group. A key icon appears on the Item Number record selector, indicating
that this field is now the primary key.
 A table is not required to have a primary key. However, it is good practice when designing a
database to include a field in all tables that can contain a unique identifier for each record, and
make this field the primary key. Doing so allows for future expansion of your database, where
several tables with related information can be linked together.
29. Click the record selector for the Max Players field. The field is selected.
30. Drag the Max Players field up one row, so the black line appears between the Release Date
and Genre fields. When the black line is between the Release Date and Genre fields, release
the mouse button. The Max Players field now appears in the fields list between the Release
Date and Genre fields.
31. With the Retail Price field selected, click the Insert Rows button in the Tools group. A new row
is inserted above the Retail Price field.
32. Type Other Accessories and press the Tab key.
33. Click the Data Type arrow for the Other Accessories field, and select Memo. Press the Tab key.
The insertion point moves to the Description property for the Other Accessories field.
34. Type List Wii accessories, other than the Nunchuk controller, that are compatible with this game.
35. Press the Enter key. The Description property for the Other Accessories field is set.
 When you update certain field properties, the Property Update Options button
might appear.
Clicking this button and then clicking the Update option in the list lets you update the field
property in certain database objects, such as Forms, that use it.
Property Update Options button
36. The Property Update Options button appears, as shown above. Click on the button and choose
Update Status Bar Text everywhere Other Accessories is used. If a dialog box appears, click OK.
37. Click in the Description property box for the Max Players field. Type Type the maximum number
of players that can play the game. Type Enter, and update the field as in step 36 above.
38. Click in the Description property box for the Nunchuk? field. Type Is the Nunchuk controller
compatible with or required for this game? Press Enter, and update the field as in step 36 above.
39. Save the changes you have made so far. Your design grid should now match the illustration below.
 The other changes we will make to the field properties will take place in the Field Properties pane,
located at the bottom of the window, below the design grid.
ICT II - Access Tutorial
Page 16
40. In the design grid, click the Rating field.
41. In the Field Properties pane, double-click the value 255 in the Field Size box to select it. Type 4.
42. Still in the Field Properties pane for the Rating field, click in the Default Value box. Type E.
43. In the design grid, click the Release Date field.
44. In the Field Properties pane, click in the Format box. An arrow appears on the right side of the box.
45. On the Format box, click the arrow. In the Format list, choose Short Date. If the Property Update
Options button appears, choose the update option (as in step 36 above).
46. In the design grid, click the Item Number field.
47. In the Field Properties pane, click in the Required box. An arrow appears on the right side of the box.
48. In the Required box, click the arrow. In the list that opens, click Yes.
49. On the Quick Access Toolbar, click the Save button. If a dialog box opens, click Yes.
50. Click on the View button in the Views group to return to Datasheet view.
51. Click in the Item Number field for the first (currently empty) record. Type 15830. Tab.
52. Type the game title: Need for Speed Nitro. Tab.
53. Because the majority of the games have an “E” rating, we previously set this as the default
value; however, we can change the default value whenever needed. Type E10+. Tab.
54. Type 11-03-09. Tab. Notice that the format automatically changes to the Short Date format.
55. Notice that while you are in the Max Players field, the contents previously inserted in the
description property for this field are displayed at the bottom left of the datasheet. Type 4. Tab.
56. Type Driving & Flying. Tab.
57. See the description at the bottom of the datasheet for this field as well. Also, notice that the
Nunchuk field, which was set as a Yes/No field, contains a checkbox. Tap the space bar one time
to place a check in the box to set the value to “Yes”, and then Tab to advance to the next field. If
the value is “No”, simply Tab to the next field, leaving the box unchecked.
58. See the description at the bottom of the datasheet for this field as well. Type Wii Wheel, Classic
Controller. Tab.
59. Type 49.99. Tab. Notice that because the field is set to Currency, it automatically adds the $ sign
to display the contents as a dollar amount; you do not have to type the $ sign.
60. Autofit the fields in the datasheet as needed so that you can see all contents. Type the remaining
four records as shown in the illustration below.
 Hint: When the field value you are about to enter is the exactly the same as that in the record
immediately above it, type <Ctrl> + ” to duplicate the value above.
61. Remember, if you have made formatting changes (such as changing the width of the field
columns, you need to save. Otherwise, Access automatically saves all data entered or edited.
Save the table.
52. Click on the Close button for the Games table. Click on the Office Button, and choose Close
Database to exit the database.
ICT II - Access Tutorial
Page 17
Microsoft Access 2007
Tutorial
– Lesson 3
Creating a Form
A form is a database object that displays data from one or more tables or queries in a format that is
similar in appearance to a paper form. Because Access forms resemble familiar paper forms, they are a
user-friendly way for individuals without technical knowledge of databases to access shared data.
The table(s) or queries that contain the data used in the form are called the record source of the form.
Most database experts agree that users should make all data entries and updates by using a form,
instead of directly in the record source, because forms provide more control over how data is
displayed, updated, and entered. Most end users (those who do not design or manage the database,
but can access and edit the data it contains) also find that working in a form is easier and more userfriendly than working directly in a datasheet.
Remember, in Lesson 2, you added a description property to a few of the fields, explaining what data
should be entered into the field. Using features such as the description property, as well as other
advanced tools, database designers and managers can build forms that include messages about how to
enter data, format data in different ways or call attention to it, or include features that prevent end
users from updating data incorrectly and editing data that should not be changed.
Access allows you to create different kinds of forms. Because all forms are based on a data source, you
first need to select the table or query in the Navigation Pane that will serve as the data source of the
form you are creating. Then, from the Create tab on the Ribbon, you will choose an option for the type
of form to create.
Access has some form tools that allow you to create forms that are more or less “automatic”:
 The Form tool creates a simple form that includes all of the fields in the selected table or
query, uses a simple format, and includes a title with the same name as the record source.
Each field in the record source appears in the form.
 The Split Form tool creates a form using all the fields in the record source and splits the window
into two panes: the form is shown at the top, and a datasheet containing the form data is shown at
the bottom.
 The Multiple Items tool creates a form that lists all the fields in a datasheet format, but using a style
that is similar to the form created by the Form tool.
 The Datasheet tool creates a form that looks just like a datasheet.
The tools listed above all create forms quickly and easily. Other form tools (described
below) allow you to customize which data fields to include, as well as how form elements
will appear.
 The Form Wizard also helps you create a form quickly, but lets you select options to specify the
record source, layout, and style.
 The Blank Form tool lets you create a form from scratch to your exact specifications.
Although it is more time-consuming and complicated, this option allows you to create a form that
exactly matches a paper form that you already use or plan to use to collect the data from sources
outside of the database system, such as customers. When you click the Blank Form button, the
blank form opens in Layout view.
 The Form Design button also allows you to create a form from scratch, but opens the blank form in
Design view, which allows you to make more advanced design changes.
ICT II - Access Tutorial
Page 18
Understanding Controls
Forms contain objects called controls.
 A bound control is connected to a field in the record source, and is used to display, enter, and
update that data.

The illustration below shows two common bound controls: text box controls (these display
and allow you to edit or enter field values for the indicated fields) and a check box control
(the Yes/No field from the datasheet).
 An unbound control is not connected to a record source. Instead, an unbound control is used to
display information (like field labels), as well as elements such as lines, rectangles, and pictures
that visually separate or enhance data in the form.

In the illustration below each text box control is accompanied by a label control, which
indicates which field the text box control is connected to.
The image below illustrates a simple form created using the Form tool.
Title
Label
control
Text box
control
Check box
control
Record
navigation bar
Layout
view
Modifying a Form Design
In this tutorial, you will be using the Form tool to create a simple, basic form into which you will enter
the rest of your data. Although the Form tool creates a basic form that is automatically formatted for
you, you can still make some changes to the layout and appearance of the form.
Change to Layout or Design view using the View button, located in the Views group on the
Ribbon. The View button has different appearances based on which view is currently selected.
Using the Form Design Tools (in Design View) or the Form Layout Tools (in Layout View), you can:





change the font style, size or color of one or more controls
resize one or more controls
move one or more controls
add unbound controls such as lines, rectangles, and labels
change the form style using the Autoformat gallery
ICT II - Access Tutorial
Page 19
Working in Form View
Once a form has been designed, change to Form View to review, edit, or add records. You can make
the same changes to data in a form that you would make in the datasheet. Like a datasheet, a form
includes a Record Navigation Bar that allows you to navigate between records.
 Use the Find command to locate a record quickly and easily. To do so, you click the Find button
in the Find group on the Home tab. The Find and Replace dialog box opens, providing several
options for finding and, if desired, replacing a field value.
You should always be careful when using Find and Replace to replace text, because you might
accidentally replace text that you did not intend to change.
The Find and Replace Dialog box
 After locating a record, you can update data in the record in the same manner as you would in
the datasheet. The changes you make in a form will appear in the form’s record source.
 Use the New button in the Records group on the Home tab of the Ribbon, or the New Record
button on the Record Navigation Bar to add a new record. The data you enter when creating a
new record in the form will be added to the form’s record source.
 You can delete a selected field value or an entire record using the Delete button in the Records
group on the Home tab of the Ribbon. Clicking the Delete button directly deletes the current
field value. The arrow below the Delete button opens options to delete either the current field
value or the entire record.
Always be careful when deleting data. You can restore the most recently deleted field value,
using Undo; however, you cannot restore an entire record that has been deleted.
Just like when editing or adding data in a table, any data changes you make in Form view are
automatically saved.
Access Activity 3.1 – Creating a Form
In this activity, you will use the skills introduced in the lesson to create and modify a basic form and enter data
into the form.
Lesson 3 Step-by-step
The following activity illustrates how to create a basic form, make modifications to the form, and enter
data into the form. The form you will design in this activity will enable you to enter the remaining data
for some of the top-selling Wii games.
1. Click the Start button -> All Programs -> Microsoft Office 2007 -> Microsoft Office Access 2007, (or
other shortcut location on your computer) to open the Access application.
ICT II - Access Tutorial
Page 20
2. Open the WiiGames_xx database you created in the Lesson 2 Step-by-Step activity.
3. If the security warning appears below the Ribbon, click Options, click the Enable this content option
button, and then click OK.
4. In the Navigation Pane, click on the Games table one time only to select, not open, it.
5. On the Ribbon, click the Create tab. In the Forms group, click the Split Form button. Notice how Access
creates a split form containing a form view at the top and a datasheet view at the bottom.
6. Click the Close button for the new form tab (below the Ribbon) to close the form. If prompted to save,
choose No.
7. On the Ribbon, click the Create tab. In the Forms group, click the Multiple Items button. Access creates
a multiple items form, which looks similar in appearance to a datasheet.
8. Click the Close button for the new form tab (below the Ribbon) to close the form. If prompted to save,
choose No.
9. On the Ribbon, click the Create tab. In the Forms group, click the Form button. Access creates a basic
form containing all of the fields in the Games table; the form should look similar to the illustration on
page 19 of this tutorial.
10. Click on the Save button on the Quick Access Toolbar. When the Save As dialog box opens, type Form:
Games in the Form Name box, and then click OK. The form is saved and appears in the Navigation
Pane.
 Look at the different controls in the form. The labels that show the different field names are
unbound label controls (they are not bound, or tied, to any data contained in the record source).
They are simply there to identify the contents in the text boxes next to them. The text boxes next to
each label, where data from the data source is shown and can be edited, are bound text box controls
(they are bound, or tied, to a field in the record source).
11. Click in the text box control for the Game Title field (the text box next to the label Game Title). Notice
that an orange outline appears around the text box control, indicating that it has been selected.
12. Point to the right edge of the selected text box control. A double-headed arrow appears. Click and drag
the right edge of the text box inward (to the left) until the text box is reduced to about ¾ of its original
width. Release the mouse button. All of the text box controls are reduced in width also.
13. Click on the Format tab under Form Layout Tools on the Ribbon. In the AutoFormat group, click on
the More arrow to open the gallery of formats. Click on the Trek format (second format in the fifth
row). The color scheme and fonts in the form change to match the selected format.
14. Click on the label control containing the text Item Number:
15. Using the tools in the Font group of the Format tab,
change the text of the label control to size 12, Dark
Red, and Bold.
16. One at a time, or using the Format Painter button
(also in the Font group), change the remaining eight
label controls to size 12, Dark Red, and Bold, so that
they match the first.
17. Click on the label control for the form title that reads
Games, and change its font size to 22. Your form
should now look like the illustration at the right.
ICT II - Access Tutorial
Page 21
18. Save the form, then click on the View button in the Views group of the Home tab on the Ribbon.
Choose Form View. It may not look much different from the Layout view you were just working in, but
you will notice that the tabs for the Form Layout Tools are no longer available on the Ribbon.
19. Refer to the records list provided by your instructor. You should have already entered records #1-5 in
the last activity.
20. Click on the New button in the Records group on the Home tab of the Ribbon, or the New (blank)
record button on the Record Navigation Bar, to create a new (blank) record.
21. Enter the next five records (#6 through #10) into the form you have created, using the data sheet
provided by your instructor. When all records #1-10 have been entered, continue with step 22.
DO NOT CONTINUE ON WITH STEP 22, BELOW, UNLESS YOU HAVE THE
FIRST 10 RECORDS FROM THE RECORDS LIST ENTERED INTO YOUR FORM!!!
22. Click on the Close button for the form (below the Ribbon). Open the Games table from the Navigation
Pane. You can see that all of the additions you made to your record source while working in the form
are showing in the table. Leave the table open.
23. Navigate to Templates -> ICT II 09_10 -> Unit 4: Database Access and open the database named
WiiGames_Append (a second Access window should open), and then open the table by the same name.
24. Select the 10 records contained in the datasheet (use the record selectors!) and Copy. Close the Access
window containing the template database and return your table (that you left open in step 22).
25. Click anywhere in the Games table to select it. Click on the arrow at the bottom of the Paste button, and
choose Paste Append. The 10 copied records are pasted to the end of the datasheet. Close the table.
26. Open the object Form: Games (that you created earlier in this activity) from the Navigation Pane. The
Record Navigation bar should indicate that there are now 20 records in the record source.
27. Click on the Game Title field of the currently showing record to select it.
28. In the Find group on the Home tab, click the Find button. The Find and Replace dialog box opens.
Notice that the field name Game Title appears in the Look In: box because this is the field you selected
before opening the Find function.
29. Change the value (there may or may not be a value to start with) in the Find What: box to Smarter.
 The Match: box allows you to indicate to what degree the value you have entered must match the
contents in the record source (match the entire value or just any part of it).
30. Because we have only typed one word from the title that we want to find in the Find What: box, we will
change the Match: box to Any Part of Field. That means that Access will locate every record where the
word “Smarter” appears anywhere in the Game Title field.
31. Click on Find Next to have Access search for the search term in the records. The record for the game we
want, “Are You Smarter Than a 5th Grader”, should appear. Click Cancel to exit the find process.
32. Update the Game Title field of the record to read Are You Smarter Than a 5th Grader: Game Time .
33. Use the Find button again to search for a record containing the word Rabbids in any part of the Game
Title field. After the search produces a result, click on the Cancel button to exit the find process.
34. Click on the arrow located next to the Delete button, located in the Records group on the Home tab.
Choose Delete Record. A dialog box appears warning you that you are about to delete one record;
click Yes.
35. Close the database.
ICT II - Access Tutorial
Page 22
Microsoft Access 2007
Tutorial
– Lesson 4
Understanding Queries
A query is a database object that lets you ask the database about the data it contains. The result of a query
is a datasheet that includes the records that you asked to see. For example, if you asked to see all of the
songs in your music library by the musical group The Beatles, your query results would show all of the songs
in the record source where The Beatles are listed in the Artist field.
 In a query, the parts of the question that specify a certain value to search for, such as The Beatles in the
example above, are called conditions. A condition (also called a criterion) is a way of telling the query
which data you are interested in seeing.
 When a condition has two or more parts to it (for example, you want to see all songs where the Artist
field contains the value The Beatles and where the Album field contains the value Help!), the two
conditions are called criteria.
 You can also create a query that contains no conditions, but displays the records you want in a certain
order.
A query is based on one or more tables, which means that the query is searching in the data contained in
the specified table(s). After you set the query conditions, or criteria, to tell Access what information you
want to find, you must run the query. Running the query displays a datasheet that contains the records that
match the conditions or criteria that you set. (For example, if you were to run the query described in the
example in the previous paragraph, Access would display a datasheet containing all of the songs in the
specified table or tables from The Beatles album Help!).
 When you view a table or query datasheet, the records may not automatically be in the order you need.
 You can apply a sort to a field, which rearranges the field values in either ascending (A to Z, or lowest to
highest) or descending (Z to A, or highest to lowest) order.
 While you can apply a sort in a table, doing so could permanently change the order of the records in the
table (which you may not want to do). Also, only one field may be sorted in a table; on the other hand, a
query allows you to sort by multiple fields.
Creating a Query in Design View
In the Query Design window, you can build and change a query using the query design grid, pictured below.
When you click on the Query Design button, located on the Create tab on the Ribbon, Access opens a
query design window as shown below, along with the Show Table dialog box which allows you to specify
which table(s) the query will be based on.
Show Table
dialog box
Field
list box
Query
design grid
ICT II - Access Tutorial
Page 23
Because databases often contain more than one table, you can select the table the query will be based
on in the Show Table dialog box. Once you have chosen the table(s) that contain the data that you want to
include in the query, you can close the Show Table dialog box and continue designing the query.
The query design window is divided into two parts:
 The top part of the window shows the field list for the table you selected as the source for your query.
 The bottom part of the window contains a query design grid that allows you to specify which fields to
include in the query results.

You can design a query to display one, some, or all of the fields from the table.

You can add fields in any order to the design grid, regardless of the order they appear in the table.

You can double-click a field name in the field list box to place it in the design grid.

You can double-click the table name at the top of the field list to select all of the fields, and then
drag any field from the field list down to the design grid in order to place all fields in the grid.
Moving and Sorting Fields in Design View
As mentioned earlier in the lesson, you can sort by one or more fields in a query. For example, you could
first sort all of the songs in your music library ascending by the Artist field, and then ascending by the
Title field, in order to sort the songs alphabetically by artist, with each artist’s songs then listed together
in alphabetical order.
 It is important to note that the field you want to sort by first (in our example, Artist) must be to the left
of the field you want to sort by next (in our example, Title). Sorts on more than one field are applied in
left-to-right order.
 To apply a sort to a field, click in the field’s Sort box. When you do so, an arrow appears in the box.
When you click the arrow, you get the options Ascending, Descending, and (not sorted).
 To move the position of a field in the design grid, click the bar above the field and drag it to the desired
location in the list. While you are dragging with the mouse, you will see a black vertical line that
indicates where the field column will be relocated.
 You can sort by a field, but not show that field in the query
results, by removing the check mark in the Show box for that
field in the design grid. In the example query shown to the
right, based on the table SUPER BOWL STATS, the query
results will show two fields (Winner and Date). The records
will first be sorted ascending (A-Z) according to the Winner,
and then within the list of each team’s wins, records will be
further sorted ascending (earliest to latest) by Date.
Sort box
Both fields will show in the query results.
Show box
Adding Conditions/Criteria to a Field
To limit the query results so that they do not show all records in the source table, but only those that meet
certain criteria, you need to add a condition to the field.
 To do so, click in the Criteria box of a field, and then type the condition. The condition would be the
value that must be contained in that field of a record in order for the record to appear in the results.
 If the field is of a Text or Memo data type, Access will add quotation marks around the condition after
you type the condition and move on to another field.
 To specify a value that may not exactly match the entire field value in a record, but will be contained in
part of the field value, type an asterisk (*) before and after the value in the condition box. The query
will return all records where the specified value matches any part of the value in that field.
ICT II - Access Tutorial
Page 24
In the example to the right, the query results will include
only those records that contain the value Nation
somewhere in the Winner League field.
Notice the asterisks and quotation marks surrounding
the text in the condition box:
“*Nation*”

The quotation marks were automatically added by
Criteria row
the Access program because the Winner League field is has a Text data type.

The asterisks were manually typed to tell Access that the condition Nation did not need to match the
field value of a record exactly, but could match any part of that field.
Access also automatically adds Like before the value in the condition. To exclude a certain record,
you can also use Not Like to display all records except the one(s) that contain the specified value.

Condition
(Criterion)
Also notice that the Show box is unchecked for the Winner League field; this field will not be displayed
in the results.
Using Operators in a Condition
Operator
Another type of condition that you can create causes a record
to be displayed in the query results when the record matches
a range of values. Range-of-value conditions include a
relational operator in the condition. The table to the right lists
the relational operators that can be used in a query condition.
In the example shown below, the query is designed to
display only those records where one of the competing
teams finished with a final score of 7 points or less.
Notice that the two criteria are on separate rows of the
Criteria area of the design grid.
>
<
=
>=
<=
<>
Description
Greater than
Less than
Equal to
Greater than or equal to
Less than or equal to
Not equal
 When more than one criteria are listed together on the same Criteria row, the And operator is in effect.
 The And operator causes the query results to show only those records that meet all of the criteria
contained in that row.
 To allow the query to return records that meet either one criteria or another, you need to enter the
second condition with the Or operator. To do so, include the second condition in the “or” row, which is
a different row, in the design grid.
Two criteria in
different rows
Criteria row
or row
Running a Query
After selecting fields to display in the query, and setting any sorting options and/or criteria, you must run
the query to see the results of the query.
To run a query, click on the Run button, located in the Results group on the Design tab. The
only records that should be displayed are ones that match the criteria set, and should be
sorted according to the sorting options selected.
If the records displayed in the query results do not seem to match your expectations, or to
change criteria to get different results, you can return to design view using the View button.
ICT II - Access Tutorial
Page 25
Access Activity 4.1 – Designing a Query
In this activity, you will use the skills introduced in the lesson to design queries to display particular information in a table.
Lesson 4 Step-by-step
The following activity illustrates how to design basic queries in order to sort data records, show selected
fields from a table, and apply conditions to select particular records from a table. You will be continuing
in the database you created, modified, and updated in Lessons 2 and 3, which contains data on some of
the top-selling Wii games.
1. Click the Start button -> All Programs -> Microsoft Office 2007 -> Microsoft Office Access 2007, (or
other shortcut location on your computer) to open the Access application.
2. Open the WiiGames_xx database you created in the Lesson 2 Step-by-Step activity.
3. If the security warning appears below the Ribbon, click Options, click the Enable this content option
button, and then click OK.
4. In the Navigation Pane, click on the Games table one time only to select, not open, it.
5. On the Ribbon, click the Create tab. In the Other group, click the Query Design button. The Query
window opens in Design view, and the Show Table dialog box opens on top of the Query window.
Games table
field list
Games
table title
Games table
fields (selected)
Games table
fields (inserted in
design grid)
Field box
Design grid
6. In the Show Table dialog box, make sure that Games is selected. Click Add. The Games table field list is
added to the Query window.
7. In the Show Table dialog box, click Close. The Show Table dialog box closes.
8. We are going to start with some simple queries to sort our records only. At the top of the Games table
field list, double-click the table title (Games). All fields are selected.
9. From the Games table field list, drag any selected field downward to the Field box at the top of the first
field column in the design grid. Release the mouse button. The fields from the Games table appear in
the design grid, as shown in the image above.
10. On the Quick Access toolbar, click the Save button. The Save As dialog box opens. The default query
name, Query 1, is selected.
ICT II - Access Tutorial
Page 26
11. In the Query Name text box, type QRY Newest Games in place of the default text. Click OK.
12. Click in the Sort box for the Release Date field. An arrow
appears on the right side of the field’s sort box. Click the arrow.
From the list that appears, choose Descending.
13. Click on the Run button, located in the Results group
on the Design tab on the Ribbon.
The query datasheet shows the records in descending order (from newest to oldest), based on the values
in the Release Date field.
14. In the Views group on the Home tab, click on the View button. The query is again displayed in Design
view. Save the query.
15. Click on the Office Button, then choose Save As. The Save As dialog box appears;
the Save to: name box contains the default text Copy of QRY Newest Games.
16. Type QRY Games Alpha List. Leave the default value of Query in the As box. Click OK.
17. Click in the Sort box for the Release Date field. Click the arrow. From the list that appears, choose (not
sorted).
18. Click in the Sort box for the Game Title field. Click the arrow. From the list that appears, choose
Ascending.
19. Click on the Run button again.
The query datasheet shows the records in ascending order (alphabetically A-Z), based on the values in the
Game Title field.
20. Click on the View button to return to design view. Save, and then close, the query.
21. In the Navigation Pane, make sure the Games table is selected.
22. On the Ribbon, click the Create tab. In the Other group, click the Query Design button. As before, the
Query window opens in Design view, and the Show Table dialog box opens on top of the Query
window.
23. In the Show Table dialog box, make sure that Games is selected. Click Add. The Games table field list is
added to the Query window.
24. In the Show Table dialog box, click Close. The Show Table dialog box closes.
25. On the Quick Access toolbar, click the Save button. The Save As dialog box opens.
26. In the Query Name text box, type QRY No Accessories in place of the default text. Click OK.
27. This time, you will choose only some fields to appear in your query results. In the Games table field list,
double-click the Game Title field. Notice that it appears in the design grid.
28. Double-click on the additional fields Nunchuk? and Other Accessories to place them in the design grid also.
29. In the Criteria box for the Nunchuk? field, type No. Run the query and view the results. Only a few
records are displayed, as most have a value of Yes in the Nunchuk? field. Return to Design view.
30. Change the criteria value in the Criteria box for the Nunchuk? field to Yes.
31. Type the value Is Null in the Criteria box for the Other Accessories field. By using this value, Access will
return only those records where the value in that field is null, or empty.
32. Run the query. Access returns a list of games that meet two criteria: they use the Nunchuk controller,
but list no other compatible accessories.
33. Return to design view. Add an Ascending sort to the Game Title field.
34. Save the query, and run it. The previous list should appear, but this time in alphabetical order.
ICT II - Access Tutorial
Page 27
35. Return to design view.
36. Click on the Office Button, and then choose Save As. The Save As dialog box appears; the Save to:
name box contains the default text Copy of QRY No Accessories.
37. Type QRY Accessories. Leave the default value of Query in the As box. Click OK.
38. In the design grid, change the Criteria box value for the Other Accessories field from Is Null to Is Not
Null (this value looks for records where the field is NOT null, or NOT empty).
39. Run the query. The results should show all of the records that have a Yes value in the Nunchuk field
and have at least one additional accessory listed.
40. Save the query, and close the query tab.
41. In the Navigation Pane, make sure the Games table is still selected.
42. Click the Query Design button on the Ribbon.
43. From the Show Table dialog box, Add the Games table. Close the Show Table dialog box.
44. On the Quick Access toolbar, click the Save button. The Save As dialog box opens.
45. In the Query Name text box, type QRY Genre in place of the default text. Click OK.
46. Again, you will choose only some fields to appear in your query results. In the Games table field list,
double-click the Game Title field, the Genre field, and the Max Players field (in that order) to place
them in the design grid.
47. Add an Ascending sort to the Genre field. Add an Ascending sort to the Game Title field.
48. Run the query. The records should appear alphabetically by game title. Return to design view.
49. Click at the top of the Genre field, to select it. Drag with the mouse to move the Genre field column so
that it is located to the left of the Game Title field (a vertical black line should appear and show the
position as you drag) , and release the mouse.
50. Run the query again. Now, your query results should show the games sorted by genre, and listed
alphabetically within in genre group.
51. Return to design view. Type the criteria value >=4 in the Criteria box of the Max Players field.
52. Run the query. Only those games with a Max Players value of 4 should be displayed in the results.
53. Return to design view. In the same Criteria row, but in the Genre field, type the criteria value *Role*.
54. Run the query. You should have no results.
Remember, when two criteria are in the same row, a record must match both criteria in order for it to
appear in the results. In this case, no record has 4 players and a genre category of Role Playing.
55. Return to design view. Remove the criteria value *Role*, using the cut function, from the Criteria row
and paste it in the Or row directly below it.
56. Run the query. You should get a list including all games with a Max Players value of 4, plus one
additional game with the Genre value Role Playing.
57. Return to design view. Save, and then close, the query.
58. Close the database.
ICT II - Access Tutorial
Page 28
Microsoft Access 2007
Tutorial
– Lesson 5
Creating Reports
A report is a database object that displays data from one or more tables or queries in a format that has
an appearance similar to a printed report. Reports can be used to provide on-screen displays or paper
printouts of data in the database.
Just as with forms, the table(s) or queries that contain the data displayed in a report are called the
record source of the report. Although the function of a report is different from that of a form, creating
or designing a report is similar in many ways to creating or designing a form. A report is designed by
placing unbound controls (such as labels and lines) and bound controls (the boxes in which the data
from the record source will be displayed) in the report document.
Because all reports, like forms, are based on a data source, you first need to select the table or query
in the Navigation Pane that will serve as the data source of the report you are creating (except when
using the Report Wizard, which will prompt you for the record source). Then, from the Create tab on
the Ribbon, you will choose an option for the type of report to create.
 The Report tool creates a simple report that includes all the fields in the selected table or query,
uses a simple columnar format, and includes a title with the same name as the record source.
Access also adds the current date and time at the top and a page number at the bottom.
 The Label Wizard lets you create a report that you can use to print standard or custom labels.
This feature is often used to create mailing labels for preparing mass mailings to many
individuals (customers, students, etc.) using the names and addresses contained in the database.
 The Report Wizard also helps you create a report quickly and easily, but lets you select
options to specify the record source, layout, and style. The Report Wizard also allows
you to select a grouping level, which organizes data based on one or more fields.
 The Blank Report tool lets you create a report from scratch to your exact specifications.
When you click the Blank Report button, the blank report opens in Layout view.
 The Report Design button also allows you to create a report from scratch, but opens the
blank report in Design view, which allows you to make more advanced design changes.
The image below illustrates a simple report (in layout view) created using the Report tool.
Margin
indicators
Picture and
title
Label
control
Date and
time the
report was
created
Records from
the record
source
Total
calculated for
the group
ICT II - Access Tutorial
Page
number
Page 29
Modifying a Report Design
In this tutorial, you will be using the Report Wizard to create a simple, basic report. Although the report
created with this tool is automatically formatted for you, you can still make some changes to the layout
and appearance of the form.
Change to Layout or Design view using the View button, located in the Views group on the
Ribbon. The View button has different appearances based on which view is currently selected.
As with modifying forms, you can use either the Report Design Tools (in Design View) or the Report
Layout Tools (in Layout View) to make changes to the report design.
Sharing Designed Reports
Once a report has been designed, it can be shared in a variety of formats. Options located on the Office
Button menu allow you to print the report, save it in other formats (such as Adobe .pdf), e-mail it in
your choice of formats, or send it via Bluetooth (provided the sending computer has a Bluetooth
device).
Access Activity 5.1 – Creating a Report
In this activity, you will use the skills introduced in the lesson to create and modify a basic report and
save it in a different format.
Lesson 5 Step-by-step
The following activity illustrates how to create a basic report using the Report Wizard, make
modifications to the report, and save a report in .pdf format. The report you will design in this activity
will display data for some of the top-selling Wii games.
1. Click the Start button -> All Programs -> Microsoft Office 2007 -> Microsoft Office Access 2007, (or
other shortcut location on your computer) to open the Access application.
2. Open the WiiGames_xx database you created in the Lesson 2 Step-by-Step activity.
3. If the security warning appears below the Ribbon, click Options, click the Enable this content option
button, and then click OK.
4. On the Ribbon, click the Create tab. In the Reports section, click the Report Wizard button. The Report
Wizard starts and opens the first dialog box, in which you choose the record source for the report and
the fields to display in the report
.
5. Click the Tables/Queries arrow, then click Table: Games in
the list. The fields for the Games table appear in the
Available Fields list box.
6. Double-click the following fields (from the
Available Fields box) in the order listed to add them to the
Selected Fields list box: Game Title, Rating, Max Players,
Genre, Retail Price.
7. Click Next. Another dialog box opens, asking how you
want to view your data.
8. In the dialog box, click by Genre. The sample page changes to show the data grouped by Genre.
9. Click Next. You won’t add an additional grouping level field to the report.
A dialog box opens and asks if you want to add a sort to the report.
10. Click the arrow on the first sort text box, click Game Title in the list (leave the sort type as Ascending),
then click Next.
ICT II - Access Tutorial
Page 30
 The next dialog box requests information about the layout and page orientation that you would like
to use in the report. A preview of the selected Stepped layout appears on the left side of the dialog
box. There are two other layout options, Block and Outline.
11. Click the Block option button to view a sample of this layout.
12. Click the Outline option button to view a sample of this layout.
13. Click the Portrait option button, click the Stepped option button, then click Next. The next dialog box
asks you to select a style (Autoformat) for the report.
14. In the list, click Urban, then click Next. The final dialog box lets you accept the default name or enter
a new one.
15. Select the default report name in the text box, type Best-Selling Wii Games by Genre, make sure the
Preview the report option button is selected, and then click Finish.
16. The report appears in Print Preview. Close Print Preview.
17. Using the View button (in the Views group), change to Layout View.
Part of the Genre field values may not be showing.
18. Click on any Genre field value. An orange outline
appears around the field values in this column. Point
to the right edge of the text box control for any
selected Genre field value until the double-headed
sizing arrow appears.
Margin of space
between columns
19. Drag outward (to the right) to widen the column so
that all genre names are completely showing and there
is a small margin of space (as shown above – the dashed lines will not appear; they are for illustration
only) between the Genre field and the Game Title field.
20. Click on the Report title to select it. Drag it slightly to the right to leave space for a small image.
21. Change to Design view. Click on the Design tab on the Ribbon, if it is not already selected.
22. In the Controls group, click on the Logo button. The Insert Picture dialog box opens,
directing you to choose the image you want to insert.
23. Navigate to the ICT II 09_10 directory in the Templates drive. Under the Unit 4: Access Database folder,
select the image Wii_logo. Click OK to insert the selected item.
24. Arrange the report title and logo as needed so that they do not overlap each other. Save.
25. Change to Report view to preview your modified report.
26. Click on the Office Button. Hold your mouse over Save As to view the Save As options, then select
Adobe PDF.
27. Browse Folders to set the save location to the Access folder in your H: drive (student directory). Type
the file name Lesson5_SBS_xx (where xx is replaced by your login name). Click Save.
28. Print or Submit the file as directed by your instructor.
29. Close the Adobe PDF document created. Close the report in Access. Close the WiiGames_xx database.
ICT II - Access Tutorial
Page 31