Professional Documents
Culture Documents
Objectives
The world generates an enormous amount of data from virtually every imaginable aspect of living -- credit cards, store merchandise, telephone
systems, web sites, etc. Years ago this was a manual effort to track and report against this information. Today, computer systems and databases
manage this information. Databases simplify our lives.
Think of an address book you might buy in a pharmacy. In it, you will write all your important contacts -- friends, family, relatives, companies,
recruiters, and other people in your network. The address book contains all the data you need to contact anyone at any time.
Now what if you needed to pull out those contacts that represent family members? Perhaps another family member might want this information. You
would have to flip through all the pages of the address book and write down the exact same information onto another piece of paper, or perhaps even
another address book. This is time-consuming. Contact records are duplicated. A change to one phone number means it has to be changed in two or
more places: in the address book and anywhere else where you recorded the information.
Over time, your address book will become old and worn. The records in it will be crossed out and changed as people move from one place to another,
or change their phone number. You need a new address book. And then you need to rewrite all that information again in a brand new book.
A database maintains order and structure in our lives. It is easy to maintain. It manages information and then shares it with other tables and databases.
Many entries in your address book will undoubtedly contain identical information -- name, address, city, state, zip code, and phone number. This
information might be written into a table called the Contacts table.
You may want to structure your address book so that family members are separated from companies called during an employment search, for
example. These categories -- family, friend, relative, company -- might appear in a second table called Contact Types.
-1-
Maybe you want write notes for certain calls. This is useful during an employment search. Information pertaining to a telephone call -- date, time,
and notes, for example -- might be saved to a third table called Calls.
The information contained in any one table might in and of itself tell us very little. The Contact Types table, for example, provides relatively little
information that stands on its own: Family, Friends, Relatives, Companies, Recruiters and Network.
However, if you could relate this table to the Contacts table -- name, address, and phone -- then you could separate contacts by category. The Contact
Types table becomes useful, therefore, when related to another table.
Similarly, by relating the Calls table with the Contacts table you can relate specific phone calls to specific people.
The power of a relational database is twofold: 1) information is managed in separate tables to make maintenance easier, 2) data can be combined by
relating different tables.
Databases play an enormous role in nearly every aspect of our lives. Think of the amount of credit card transactions that take place during a given
day, from receiving authorization at the point-of-sale, to applying the purchase to your credit card, to the store receiving payment from the credit card
company. There are many stores, many banks, and many credit cards involved. Databases are all around you. You only need to learn how to view the
world in terms of databases.
Think of your favorite department store. Chances are the one you shop at is just one of several in the chain. And these stores are probably located in
different states. Databases manage this information.
Inside the store there are different departments: Ladies', Men's, and Electronics, to name a few. Within Electronics, there are different categories
called classes and these might be represented by radios, televisions, CDs, and DVDs. More databases.
And within any given class -- CDs, for example -- there are subclasses like jazz, rock, country, and classical. Within rock there are bands and within
bands there are recordings.
-2-
This structure categorizes different kinds of information at nearly every level of the store. It is essential to maintaining order and accuracy.
How do these databases work together? Well, everything in retail begins with the product or item. Each item has a barcode that uniquely identifies it.
These items are defined in an Item database and associated with a specific department defined in a Department database.
When a buyer decides to purchase some products for sale in a store, he or she creates an order in a Purchase Order database, pulling the individual
items to buy from the Item database. The order might then be transferred to Communications databases that electronically transmit the order to the
vendor, and also to an Accounts Payable database to pay for the merchandise.
Trucks deliver merchandise to the store (don't forget the vendor has their own databases that tells what they shipped), where the products received are
input into a Receiving database. The received quantities are then matched against the original Order database to make sure that all products
ordered were received.
An Inventory database might tell the sales clerk which items to move to the selling floor because the shelves are bare, and what other items might
be stored in the stockroom. For items moved to the selling floor, a Shelf Planning database might tell the clerk exactly where to place the product on
the shelf.
When you shop and take items to the checkout counter, the cash register will lookup the price of each item in the Price Lookup database. Want to
pay by check or credit card? Databases are used to ensure that sufficient funds are available in the account.
Every item sold in the store needs to be removed from inventory so that it can be re-ordered. This adjustment might be made in the Inventory table
to alert the buyer that a certain amount of items need to be ordered to refresh the store's inventory.
Many things happen and many databases are used to make sure the products you want make their way from the manufacturer to the stores and then
into your homes.
Challenge!
The next time you are in a restaurant, a supermarket, or just driving through a stop light, think of what is going on around you, and try to see what
goes on behind the scenes as if everything supporting it is managed by a database.
• A restaurant needs to buy food to make menu items. The menu is structured in some manner. The restaurant has to pay bills. Customers
have to pay for meals.
• The supermarket is stocked with items. Items are ordered, shipped, and stocked in the store. The supermarket has bills to pay. The cash
register looks up prices. The customer pays for products.
• Streets are built in towns. Traffic lights are installed at intersections. How do these lights work? Do they all turn red at the same time? Do
they all turn green at the same time?
Now think of your home and view it in terms of a database. For example, you buy products. How is your checkbook managed? There are different
rooms in your house. What are they and what is contained in each? You develop dinner throughout the week. Is there a menu driving what you have
or do you eat certain dishes on certain nights?
Come up with two different aspects of home living and think about whether or not it can be supported by a database. This is not to say that we are
going to create a database for it; only to think of a structure or organization behind some process.
-3-
-4-
Lesson 2: Database Concepts
Objectives
What is a Database?
A database is a collection of information organized and presented to serve a specific purpose. Database programs are created using a program like
Microsoft Access 2003.
• Tables
• Forms
• Queries
• Reports
These components are called database objects. One or more of these objects are formed when a database is created. These components are stored in
a single database file.
What is a Table?
Data is stored in one or more tables. Separate tables are usually created for specific topics, such as products or suppliers. Tables can be related to one
another to access the different types of information. Because data is stored only once -- you probably would not save the same information in two
different tables -- your database becomes more efficient.
The columns and rows in an Access table resemble an Excel spreadsheet. Tables organize data into columns (called fields) and rows (called
records). A record is comprised of one or more fields, depending on the number of fields defined to the table.
-5-
Individual fields in an address book table might consist of name, street address, city, state, zip code, and phone number. A single record is an entry
that uses all these fields, such as your brother or sister's contact information.
What is a Query?
A query lets you find and retrieve information from one or more tables based on a set of search conditions you define (e.g., certain fields in one or
more tables). The results can be displayed in a manner of your choosing. Queries can be created using a wizard or developed from scratch in the
Query Design view.
What is a Form?
An online form can be created to view, input or change information in one or more tables. In this course, we will see how forms are used as both
menus and as data entry forms to database tables. Forms can retrieve data from one or more tables, and display the output on the screen.
-6-
What is a Report?
A report is an effective way to analyze and present data in a printed format using a specific layout. You have control over the size and appearance of
information printed on the report, similar to formatting you perform in a Microsoft Word document.
Challenge!
The best way to understand databases is to learn how to view the world and the things in it, and then think of structures that best serve to organize
this information.
For example, think of your music collection in terms of a database. The database might be called music collection. What tables might be in this
database?
• Do you have both CDs and tapes, or just tapes? Could this media type be an example?
• Do you listen to different styles of music? Could music style be a table?
• Do you listen to different musical artists? Could musical artists be a table?
• Do you have more than one recording for any artist? Could specific recordings be a table?
1. Using the questions above, outline a structure using those questions for which you answered "yes" (or any other questions that you might
think of).
2. List at least five items from your collection that could go into each category created in step #1. If your music collection is not large enough
to list five items in each category, then think of artists that you know about and use this information as if you owned it.
3. After completing step #2, the database has some information defined to it. What report might you want to print that tells you about some
part of the information in the database?
This step, looking at the information to be categorized, is the first step toward designing a database.
-7-
-8-
Lesson 3: Identifying the basic parts of the Access window
Objectives
Microsoft Access is launched from the Windows desktop in a manner similar to that used to launch Microsoft Word, Excel, or PowerPoint. You can
launch Microsoft Access either from the desktop shortcut or from the Start program.
• Click the Start button located in the lower left corner of the Windows screen.
• Click the Programs option on the Start menu.
• Click the Microsoft Access selection.
(If Access does not appear, then click the double down areas immediately below the Microsoft PowerPoint entry and locate Access from a
complete list of software installed on your computer.
When you open Microsoft Access, many items you see are standard in most Microsoft software programs like Word, Excel, and PowerPoint.
-9-
Menu bar
The Menu bar displays all the menus available for use in Access 2003. The contents of any menu can be displayed by clicking on the menu with the
left mouse button.
Toolbar
The pictured buttons in the toolbar are quick and easy shortcuts to specific actions. For example, if you want to save a spreadsheet using the menus
then you would first click File and then click Save. Using the toolbar to perform this save operation actually saves you a click. Click the save button
once to save the spreadsheet.
Some commands in the menus have pictures or icons associated with them. These pictures may also appear as shortcuts in the Toolbar.
Database Toolbar
- 10 -
The Database toolbar presents operations that can be performed against different database objects, including buttons to open an object, design an
object, create a new object and delete an object.
Left Pane
Database objects are created and opened by choosing any of the buttons listed in the left pane of the database window.
Right Pane
Any of the first four options -- Tables, Queries, Forms, or Reports -- opens additional choices related to that selection in the right pane.
Choosing the Tables button, for example, displays at least three options in the right pane: 1) Create a table in Design view, 2) Create a table by using
wizard, and 3) Create table by entering data. It also shows any objects that you created in the database.
Challenge!
• Display the contents of the File, Edit, View, Insert, Tools, Window, and Help menus in the main Access menu bar. As each menu is
displayed, you may want to write down all the contents listed under each.
• Identify the operation performed by each button in the main Access toolbar.
• Some buttons in the toolbar also appear alongside options listed in a menu. For each button in the main Access toolbar, identify the menu
where that operation can be performed.
- 11 -
Access 2003
Objectives
Datasheet basics
The core component of a database is a table. Data is defined and stored in a table. Multiple tables -- each consisting of different types of data -- can
be created in a database.
Each row in the database is called a record. The entry for John Smith is called a record. The entry for Martha Tompkins is also a record. Each row or
record is made up of columns or fields -- L.Name, F.Name, Phone, Address, City, State, Zip -- which contain a particular piece of information.
In a Contact Management database, a list of names -- those contacts to whom you have sent resumes or have met through your personal network --
might be maintained in a table, along with address, phone number, and other personal information.
Field Properties
Every table contains a number of columns called fields or datatypes. Fields are unique pieces of information that make up the information in a table.
Tables usually contain multiple fields.
In a previous example we mentioned that a table might consist of the fields: Last Name, First Name, Phone, Address, City, State, and Zip. Each field
has unique properties. Some contain characters. Others contain numbers. These Field Properties are defined when the table is created.
- 12 -
Understanding Table Relationships
Databases can be simple -- consisting of a single table -- or made up of many different tables. If you were to convert your resume into a database, for
example, you might have a table that contains your name and personal mailing address. We might call this the Contact_Information table.
Your work experience is a different kind of information. Instead of identifying who you are or where you live, it identifies the companies you worked
for, their addresses, your job title, and responsibilities. Because this set of information is independent from the contact information, we might instead
create a second table called the Work_Experience table.
The same is true of your educational background. It has no direct bearing on your contact information or the companies where you worked. A third
table might be created called the Education table to save this kind of data.
The database contains three tables, each independent of the other, and all containing different types of information. The database needs a way to
connect these three tables.
Primary Keys
Every table in Microsoft Access must have at least one field that uniquely identifies each record in the table. This field is known as a primary key.
This primary key essentially opens the door to the table and allows you to retrieve information from the table.
The primary key is the mechanism by which you relate different tables and combine information for viewing (query) or printing (report).
- 13 -
Challenge!
Let us pretend that you are going to start your own home business. You are going to need to prepare a database for your business and the first step is
to design a table that will contain a list of all your contacts that may one day be your clients or suppliers.
Let us assume that a database table called Business Contacts contains all the fields listed in the first column of the following chart. The chart also
contains four other columns:
• Text, Numbers or Both -- should the field accept data entry input in the form of text, numbers, or both?
• Field Size -- the number of spaces you think the field should have.
• Required Entry -- should the field be required entry (the record cannot be added to the database without the information) or optional entry
(a record can be added without entry in the field)
• Allow Duplicates -- should the database allow duplicate entries for the field (e.g., can several people in the database share the same zip
code)?
Text, Numbers, or
Field Size Required Entry? Allow Duplicates?
Both?
First Name
Last Name
Company
Company Type
Address
City
State
Zip Code
Contact Id
Title
Work phone
Fax Number
- 14 -
Lesson 5: Getting to know the Contact Management database
Objectives
The Contact Management database used in this course can be downloaded from the GCFLearnFree.org® Web site and installed on your computer.
GCFLearnFree.org's Access 2003 lessons all use examples from the Contact Management Database. However, if you'd rather work with another
existing database, you should have little problem following our lessons.
• Click the link, and download and save the Contact Management database (992k).
(Note, you must have an open connection to the Internet in order to download the database).
- 15 -
Now that you've downloaded the Contact Management database, let us open and become familiar with it. We will briefly discuss how it was created
and look at some of its database components.
If properly downloaded, the Contact Management database will be present in the c:\My Documents folder on your computer. It is recommended that
you do not move the database from this location until after you have completed the Access 2003 course.
• Open Microsoft Access by selecting its associated icon on the Windows desktop.
• Choose File Open from the menu bar.
• The Look In box in Microsoft Access 2003 defaults to the c:\My Documents when the application is first opened.
If the My Documents folder does not appear in the Look In box, then click in the Look In drop-down box, and locate and select the My
Documents folder.
• Select the Contact Management.mdb file.
The main Contact Management database screen appears on your computer screen:
- 16 -
Reviewing the Contact Management Tables
Tables are found in the database Object called Tables. The Contact Management database contains four tables: Calls, Contact Types, Contacts, and
Switchboard Items.
Forms are found in the database Object called Forms. The Contact Management database has seven forms that are used as both menus and data entry
screens. These forms are Call Details Subform, Call Listing Subform, Calls, Contact Types, Contacts, Report Date Range, and Switchboard. You can
define additional forms to meet your data entry needs.
- 17 -
Reviewing the Contact Management Reports
Reports are found in the database Object called Reports. The Contact Management database has two reports defined to it: Alphabetical Contact
Listing and Weekly Call Summary reports. You can define additional reports in the database depending on your reporting needs.
Challenge!
• If you haven't already done so, download and save the Contact Management database. (Note, you must have an open connection to the
Internet in order to download the database).
• Open the Contact Management database and view each of the following:
o Tables object
o Queries object
o Forms object
o Reports object
- 18 -
- 19 -
Lesson 6: Using a Wizard to Create the Contact Management Database
Objectives
The Contact Management database was created using the Microsoft Access Database Wizard. We will briefly review the steps involved in creating
this database.
Microsoft Access 2003 is equipped with a database wizard that can be used to create any of ten simple databases: Asset Tracking, Contact
Management, Event Management, Expenses, Inventory Control, Ledger, Order Entry, Resource Scheduling, Service Call Management, and Time and
Billing.
In this lesson we will briefly review the steps involved in creating the Contact Management database.
How the Contact Management Database was Created Using the Database Wizard:
• If the Templates window does not show, you may need to select On my computer from the task pane on the right side of your screen.
- 20 -
• Click the OK button to launch the wizard.
The first screen of the wizard verifies the type of information that will be stored in the Contact Management database: Contact information and Call
information.
Selecting the Tables and Fields to be included in the Contact Management Database
The second screen of the wizard identifies the tables to be created. Three tables were created: Contact information, Call information, and Contact
Types.
Click on any table to display the fields contained to it in the Fields in the table column. Click on a different table and other fields used by that table
will replace the ones displayed for the table selected.
- 21 -
• Accept all other default field selections by leaving those checkboxes marked by a check.
• Click the Next button to continue.
The third screen asks the question, What style would you like for screen displays? Microsoft Access provides ten different screen displays for your
use. A thumbnail picture is also provided for each format listed.
• Click through the different format options displayed on the screen -- Blends, Blueprint, Expedition, etc. -- to display a picture of each
format on the left side of the wizard screen. Highlight the desired format -- the Contact Management database used the Standard format --
to be used.
• Click the Next button to continue.
The third screen asks the question, What style would you like for printed reports? Microsoft Access provides six different report displays for your
use. A thumbnail picture is also provided for each format listed.
- 22 -
• Click through the different format options displayed on the screen -- Bold, Casual, Compact, etc. -- to display a picture of each format on
the left side of the wizard screen. Highlight the desired format -- the Contact Management database used the Corporate format -- to be used.
• Click the Next button to continue.
• Assign a name to the database by typing a file name in the What would you like the title of the database to be field.
• Click the Next button to continue.
The final step asks whether the database being created is to be opened after it is built by the wizard? It has no bearing whatsoever on the actual
building of the database. If you don't want to open the new database at this point then you can always return to it later and open it in Microsoft
Access.
- 23 -
• Leave or remove the checkmark that appears in the checkbox associated with the Yes, start the database prompt.
• Click the Finish button to initiate the database build.
Challenge!
• Review the Database Wizard screens shown in this lesson. These are the same screens used to create the Contact Management database.
• Open Microsoft Access.
• Choose File and then New from the menu bar.
• Select On my computer... under the Templates section of the Task Pane.
• Select the Expenses database. This is a good example of a database that could be used by a business to track expenses.
• Follow the steps indicated by the wizard to create the database. Make sure the box beside Yes, start the database is checked on the
screen of the wizard.
• Navigate through the database by selecting various forms, tables, etc.
- 24 -
Lesson 7: Opening a Table and Learning to Navigate Records
Objectives
Tables are created and maintained in the Tables tab of the Objects palette in Microsoft Access. The Contact Management database contains four
tables: Calls, Contact Types, Contacts, and Switchboard Items. We will discuss the Contacts table in this lesson.
A table opened in Datasheet View resembles a Microsoft Excel spreadsheet. It is used to input records into the database and will be discussed in this
lesson.
(If the database window is not displayed, then choose Window Contact Management: Database from the menu bar.)
• To open the table in Datasheet View, double-click the Contacts table in the right window pane.
(You could also either click once on the Contacts form and then click the Open button, or you could right-click on the Contacts form and
select Open from the shortcut menu.
The Datasheet View looks like an Excel spreadsheet. It consists of columns and rows. Field names -- Contact ID, First Name, Last Name, Dear,
Address, City, State, etc. -- appear as column headings. Records represent rows with data input into the fields. The number of rows that appear in the
table will equal the number of records that have been added to the table. One blank row always appears as the last row of the database. This blank
row is used to add a new record the table.
- 25 -
The status area in the lower left area of the window indicates the number of records in the table as well as the record number displayed in the
window.
• Click the arrows in the status area to move to the first record, previous record, next record, or last record in the table.
• The new record button displays a blank row into which information for a new record can be added to the table.
The vertical scroll bar is located along the right edge of the screen and can be used to move up or down the table if the total number of records
exceed the records shown on the screen. Similarly, the horizontal scroll bar located at the bottom of the screen can be used to move left or right
across the window if the fields in a table exceed the number of fields displayed on the screen.
• Click the up or down arrows in the scroll bar to move up or down through the table records.
Another way to navigate records in a table is to scroll up and down one screen at a time using the PageUp and PageDown keys on the keyboard.
Other keys also provide shortcuts to move through fields and records, including:
The Record Selector located to the left of each record in Datasheet View identifies the operation being performed against a selected record at any
given time.
• indicates the current record. The record is saved with the information displayed on the screen.
• indicates the selected record is being edited and the changes have not yet been saved.
• indicates a blank record into which information for a new record can be added to the table.
A blank record row always appears as the last row in a table. You must add new table records using this row.
Challenge!
- 27 -
Lesson 8: Viewing and Adding Table Records
Objectives
Each record in a table is represented by a row. Field names are represented as columns in the table. To add a new record, navigate to the last row in
the table -- it is a blank row -- or click the new record button in the Status Area. Then, input the requested information into each field in the new
record. In this lesson, you will add a new record to the Contact Table.
• If not already displayed, open the Contacts table in the Contact Management database.
• Click on the New Record button to display a blank row for data entry.
• Moving left to right across the screen, type the requested information into each field of the record. If the field label reads, First Name, type
the first name of the individual being entered into the table.
• Press the Tab key to move from one field to the next, or left-click with your mouse in the next field.
• Complete entries in the remaining form fields: Last Name, Company, Address, City, State/Province, Postal Code, Country, Title, Work
Phone, Work Extension, Mobile Phone, Fax Number, Contact Type, Email Name, Referred By, and Notes pertaining to the contact.
• Press the Tab key at the last column to start another record, or click the New Record button again.
Saving Your Work: Information in a table is saved automatically when the mouse, an arrow key, the Tab key, or the Enter key is used to move
the cursor out of that row and into a different record.
You can manually save data being entered for a record as you work your way across the different fields in the record -- there are many fields in the
record. Choose Records Save on the standard toolbar to save data without moving the cursor out of the record's row.
Adjusting a column width in Access is similar to Microsoft Excel. By default, each column in Access is 15.6667 characters wide. Each individual
column can be enlarged to 363 characters wide.
When entering records, you may need to resize columns to view the information as it is being typed. The width of an address column, for example,
might be smaller than the actual address. You can adjust the column width of any field so it is wide enough to view the complete field entry.
In Access, you can adjust column width manually, use AutoFit, or use the menu bar.
• Place your mouse pointer to the right side of the gray column header.
• The mouse pointer changes to the adjustment tool (double-headed arrow).
- 28 -
• Drag the Adjustment tool left or right to the desired width and release the mouse button.
• Place your mouse pointer to the right side of the column header.
• The mouse pointer changes to the adjustment tool (double-headed arrow).
• Double-click the column header border.
• Access "AutoFits" the column, making the entire column slightly larger than the largest entry contained in it.
To access AutoFit from the menu bar, choose Format Column Width, and then check the Best Fit checkbox.
Each row in Access defaults to a height of 12.75 but can be enlarged to 1638. Changing the height of a row is similar to adjusting a column width
with two exceptions: 1) a row height change applies to all the rows in a table, and 2) auto-fit is not available at the row level.
- 29 -
• Type a new specification in the Row Height field.
Saving Your Work: If you changed the table layout, you will be prompted to save the changes when you exit Microsoft Access.
Challenge!
• Open the Expenses database you created with the database wizard in lesson 6.
• Open the Employees table in Datasheet View and input the following records in the proper fields:
o Joe Smith, 44 Highhouse Road, Cary, NC 27513, United States, 111-11-1111 (Social Security Number), 40 (Employee Number),
Salesperson (Title), 919-555-1212 (Work Phone), and 100 (Extension).
o Jane Allen, 123 Atlantic Avenue, Raleigh, NC 27516, United States, 222-22-2222 (Social Security Number), 56 (Employee
Number), Director of Sales (Title), 919-555-1234 (Work Phone), and 200 (Extension).
o Pete Moss, 567 Helix Court, Raleigh, NC 27606, United States, 333-33-3333 (Social Security Number), 75 (Employee Number),
Clerk (Title), 919-555-5678 (Work Phone), and 300 (Extension).
• Resize the Social Security Number column using the menu bar method.
• Resize the Employee Number column using the manual adjust method.
• Resize the State/Province column using the auto-fit method.
• Save and close the document
- 30 -
Lesson 9: Editing and Deleting Table Records
Objectives
Information in a record is likely to change over time, when someone moves from one address to another, or when someone else changes his or her
phone number. Information can be changed in any field of any table record.
• Move the mouse over the field you want to edit. The mouse pointer changes to an I-beam.
• To add characters to the field information (e.g., a letter needs to be added to a word), click once in the field at the spot where the
information needs to be changed. An insertion point | appears.
• To overwrite a word in the field (e.g., "Road" needs to change to "Street"), double-click (or click-and-drag across the word) on the word
in the field. Type the new information directly over the highlighted word.
Sometimes, you will need to change the entire contents of a field (e.g., someone has a new address). In Access, you can select an entire field for
editing.
• Move the mouse pointer to the left edge of the field you want to edit.
• The mouse pointer changes to a selection tool, a large cross.
• Click to select the field.
• Type the new information.
Warning! When attempting to edit an entire field, be careful not to move the mouse pointer so far to the left that you click on the Record
Selector (pointer changes to an arrow pointing right) and select the entire record. In Access, you cannot edit fields when the entire record selected.
Saving Your Work: Unlike the Word, Excel, or PowerPoint applications, you will not be prompted to save the data you entered when you exit
the screen or close application. In Access, each record is saved automatically when you move to another record.
Cut, Copy, and Paste are very useful operations in Microsoft products, including Access 2003. These operations allow you to quickly copy and/or
cut information in fields for pasting into other fields. These operations save you a lot of time from having to type and retype the same information.
The Cut, Copy, and Paste buttons are located on the Standard toolbar.
The Cut, Copy, and Paste operations also appear as choices in the Edit menu:
- 31 -
The Cut, Copy, and Paste operations can also be performed through shortcut keys:
Cut Ctrl + X
Copy Ctrl + C
Paste Ctrl + V
There might be occasions when you do something to a table -- type the wrong number in a cell, for example -- that you didn't mean to do.
Fortunately, you can undo an operation in Access 2003. The Undo operation recovers the last single action performed.
Certain rules govern use of the Undo feature. First, the record needs to be edited in Datasheet View. Also, Undo becomes unavailable when:
• A different field is edited (Undo of the last field edit cannot be performed).
• A different record is edited (Undo of the last saved record cannot be performed).
• A different window is displayed.
• A filter is applied or removed (filters are discussed in a later lesson.)
- 32 -
To Undo the Last Change to the Current Field, use one of the following methods:
Spelling data correctly in Microsoft Access is essential. Sloppy data-entry work -- the customer name Smithsson is mistakenly typed when the name
is actually Smithson -- can potentially leave the contact out of future queries or reports. The Spelling Check feature searches for spelling errors in a
table, form, or query. In a table, Spelling Check specifically checks the spelling of records, fields, or text within a field.
• Click on the Spelling button , or choose Tools Spelling from the menu bar, or press the F7 shortcut key. The Spelling dialog box
opens.
• Access provides an alert whenever a word is found that is not in the Dictionary file. The unrecognized word is displayed in the Not in
Dictionary text box.
• Correct the word either by performing any of the following actions:
• A notification dialog box is opened when Access completes the spelling check. Click the OK button to close the dialog box.
One or more table records can be deleted from an Access table at any time while in Datasheet View.
• Press the Delete key or click the Delete Record button on the toolbar.
- 33 -
• A dialog box is displayed to confirm that the record is to be deleted. Click the Yes button to complete the delete operation.
• Click the Record Selector to the left of the first record to be deleted, and then drag the cursor up or down across multiple Record Selectors
to select consecutive records.
(or hold the Shift key and click the Record Selector field in each consecutive record to be marked for delete.)
• Press the Delete key to mark the records for delete, click the Delete Record button, or choose Edit Delete from the menu bar.
• A dialog box is displayed to confirm the record(s) to be deleted. Click the Yes button to complete the delete operation.
Important to Remember:
Deleting records is permanent. It cannot be reversed through an Undo operation. Use caution when the dialog box is displayed to confirm the
record(s) to be deleted.
Challenge!
Navigate to the Joe Smith record, cut the City entry and then type "Apex" as the new City.
Copy Jane Allen's Work Phone and paste it in Pete Moss's Work Phone.
Delete the Joe Smith record
Save and close the document.
- 34 -
Lesson 11: Editing Form Records
Objectives
Contact records need to be updated whenever information changes. Changes occur when people move from one address to another, switch
companies, or change phone numbers. In the Contact Management database, you can change this information using the Contacts form.
Navigating through records in a form works very much like navigating through records in Datasheet View. The Form View window contains a
status area in the lower left corner. Use the arrows to navigate through the forms.
• Click the arrows in the status area to move to the first record, previous record, next record, or last record in the table.
• The new record button displays a blank form into which information for a new record can be added to the table.
Information will undoubtedly change in your database. Contacts move to a different address, change their telephone numbers, or switch companies.
You can either change the information for any of these records, or, if no longer needed, even delete the record from the database.
Editing a form record in Access is very easy. It entails locating the record and then typing the corrected information in the appropriate field.
- 35 -
• Using the status area to navigate the forms, display the form record that is to be edited.
• Either click in a field or use the keyboard to navigate to the first field to be changed or added.
• Type the new information or correct the information in the selected field.
• Navigate to the next field that needs to be corrected and make any necessary changes.
• When finished editing information on this page, click the Page 2 button to display additional fields.
In the previous lesson, we saw how to enter new Contact Types on the Contact Types form. These entries are now available for use in the Contact
Type field of the Contacts form.
• Click on the drop-down button associated with Contact Type. If you successfully completed the challenge in the last lesson, this drop-down
list now contains several entries: Family, Friend, Relative, Work, Recruiter, Company, and Network.
Saving Your Work: After you input the data into a form record, Access automatically saves the record when you use the mouse, an arrow
key, the Tab key, or the Enter key to move the cursor out of that field and into a different field, or record.
Remember, you can always add records to the Contact Types table while in Datasheet View. First, click on the Tables tab from the Object
palette of the database window. Then double-click the Contact Types table to open the table in Datasheet View.
Challenge!
- 36 -
- 37 -
Lesson 12: Sorting Records
Objectives
Sorting is one method that helps you find information quickly and easily in a database. Records can be sorted in ascending order (A-Z), and
descending order (Z-A). You can sort by zip code, last name, first name, company, contact type (e.g., family, friend, relative), etc. You can even
sort by contact type and then by last name within each contact type.
It's easiest to see the results of a sort if you work in Datasheet View.
To Sort Records:
• Click anywhere in the column you want to sort by (e.g., Last Name).
• Click the Ascending or Descending button on the toolbar (or choose Records Sort Sort Ascending or Sort Descending from the
menu bar).
To sort by Form View, switch to Form View, select the field you want to sort by, and click the Sort button on the toolbar. To see the results, use
the status area to move through the records.
Multi-field sorting allows you to define multiple fields in your sort. You specify the column to sort by, (e.g., Last Name), and within that column
sort by some other specified field (e.g., First Name). For example, you could sort all the Brown records by first name.
- 38 -
• Open the desired form or table in Datasheet View.
• Move the columns to be included in the sort so they are positioned alongside one another.
Moving a column in Access is much like moving a column in Excel. Click in the column heading of one field to highlight the entire column.
Then, drag the entire column so that it sits alongside the other column(s) to be used in the sort.
• The column to be sorted first should be positioned to the left of the second column to be sorted, and so on.
• Click the Ascending or Descending button on the toolbar to sort the records (or choose Records Sort Sort Ascending or Sort
Descending from the menu bar).
Removing a Sort
After a sort is performed, you will be given the option to save the sort or to remove it to allow the records to return to the way they were ordered
before you applied the sort.
- 39 -
The records revert to their ordering before the sort was applied.
If you add new records to a table that has been sorted, any new records are automatically saved.
Saving a sort
When you open a table in Access -- any table -- the records are displayed in order based on values that appear in the primary key field. In other
words, Access defaults to a sort on the primary key when a table is opened. A sort can be performed against any field listed in a table, however.
Sorting table records actually change the table design. When you attempt to close a table after a sort, Access will prompt you to save the changes to
the table design.
To save a sort:
The sort order is saved. When you open the table again, the records will still be sorted.
To cancel a sort:
The change is not saved; the table remains in its original design.
Challenge!
o Move the City field to the right of the State field and sort (descending or ascending) the records by State and City.
o Move the City field to the right of the Last Name field and sort (descending or ascending) the records by Last Name and City.
- 40 -
Lesson 13: Finding Records
Objectives
When you have an extremely large database consisting of thousands of records, you may need to quickly locate one of them. Access provides an easy
way to find individual records: the Find function.
• Click anywhere in the field that contains the data you want to search (e.g., Last Name).
• Choose Edit Find on the menu bar or click the Find button on the toolbar to open the Find and Replace dialog box.
• In the Find What field, type the information you want to search. It may be a last name (e.g., Manning) or a portion of the last name (e.g.,
Man).
• The Look In drop-down box defaults to the field or column where the cursor was positioned when the Find was initiated. You can leave
the definition as is if you know the information is contained in this field, or you can select search the entire table from the drop-down menu
list.
• In the Match field, Access defaults to Whole Field but you can optionally select either Any Part of Field or Start of Field.
• Click the Find Next button to search for the first occurrence of a record that matches the search.
• Click the Cancel button if the record was found. The Find and Replace dialog box will close.
OR
• Click the Find Next button to search for the next record that meets the Find criteria.
In the event that Access did not find a match for the search, the Office Assistant will pop up to inform you that there were not any matched records
found.
- 41 -
Using Wildcards to find records
If the simple Find did not find the record you sought then you can try typing an operator in the Find What text box of the Find and Replace dialog
box. A common Access operator is a wildcard, a symbol representing one or more characters.
* (Asterisk) Used at the beginning or the end of a search string to match one or Sch* finds Schlotz and Schwartz. *ing finds Wheeling
more characters and Browning.
? (Question Mark) Matches any single alphabetic character Sp?ll finds spell and spill.
# (Pound Sign) Matches any single numeric character 9#1 finds 901, 911, 921, etc.
• Choose Edit Find on the menu bar or click the Find button on the toolbar to open the Find and Replace dialog box.
• In the Find What field, type the wildcard combination (e.g., B*) to find the first record where the Last Name begins with the letter B.
• Click the Find Next button to begin the search. The first record found that matches the search is highlighted.
(The Office Assistant will provide notification if no matching records were found).
• Click the Cancel button if the record was found. The Find and Replace dialog box will close.
OR
• Click the Find Next button to search for the next record that meets the Find criteria.
Challenge!
- 42 -
Lesson 14: Filtering Records
Objectives
At times, you might want to view only those records that match a specific criterion. A filter is a technique that lets you view and work with a subset
of data. Applying a filter to an Access table, form, or query temporarily hides records that don't meet your search criteria. For example, you may
only want to work with data pertaining to a specific zip code.
To Filter By Selection:
• Click anywhere in the field that you want to filter the records in the table.
• Click the Filter by Selection button in the standard toolbar or choose Records Filter Filter By Selection from the menu bar to apply
the filtering.
• The filter produces a display that shows only those records that match the filter's definition (e.g., North Carolina). The status area reflects
only the filtered records.
Removing a Filter
To Remove a Filter:
- 43 -
• Click the Remove Filter button on the standard toolbar or choose Records Remove Filter/Sort from the menu bar.
• The records revert to their ordering before the sort was applied.
• Optional, if you wish to reapply the filter, click the Apply Filter button (This button acts like a toggle to turn the filter on and then turn the
filter off).
Saving a Filter
Access defaults to displaying all records in a table. Filters are not applied to the table initially. Filtering table records actually change the table design.
When you attempt to close a table after a filter, Access will prompt you to save the changes to the table design.
To save a filter:
When you open the table or form later, all the records will be visible. Click the Apply Filter button to reapply the filter. However, Access saves
only the last filter you create.
You can apply filters to filtered data to narrow your search even further.
To cancel a filter:
The change is not saved; the table remains in its original design.
The Filter Excluding Selection works in the opposite manner as the Filter by Selection. Instead of specifying the filter to be used to view records
(e.g., everybody in North Carolina), Filter Excluding allows you to view data that does not include the specified criterion (e.g., everybody not in
North Carolina).
• Choose Record Filter Excluding Selection from the menu bar or right-click and choose Filter Excluding Selection from the shortcut
menu.
• All records except the criterion you excluded are now visible.
• The status area shows only the filtered records displayed on the screen.
The Filter by Form feature is used when you are working in Form view and not in Datasheet View. Filter by Form works the same way as the Filter
by Selection method, except the filtering is defined on a blank contact data entry form as if you were creating a new contact record.
To Filter by Form:
• In Form View or Datasheet View, click the New Record button to create a blank form or datasheet.
• Select a filter value from the drop down list (e.g., North Carolina, to view all records in North Carolina).
- 45 -
• To display records meeting more than one search criteria, click the Or tab located at the bottom of the screen. Otherwise, continue to the
next step.
• Click the Apply Filter button to apply the filter and view the filtered records.
Challenge!
- 46 -
Lesson 15: Running Database Queries
Objectives
Like tables and forms, a query is another type of database object in Access 2002 XP. A query is a search for records that match the exact criteria
you define. In this example, we will run a query against the Contacts table and list all records found by Last Name, First Name, and Work phone.
• The query searches the database and then displays the results on the screen.
In this example, we will create a new query and run it against that very same Contacts table. We will type the following command in the table: Show
me the mailing address of all records in the Contacts table. When we create the query, we need to select the following fields in the Contacts table:
Last Name, First Name, Address, City, State/Province, and Postal Code.
• From the Tables/Queries drop-down list, choose the table/query containing the fields you want to include in the query.
• The Available Fields text box displays all the fields contained in the table selected in the Tables/Queries field. You are to select the fields
to be used in the new query. You can pick one or more, or even all fields in the query.
- 48 -
Click to highlight the first field to be included in the query -- Last Name, for example -- and then click the right arrow button. Repeat until
you have selected all fields to be used (First Name, Address, City, State/Province, and Postal Code).
• If the fields you selected include a number field, you are asked to select a summary or detail query. To see each record, choose Detail. To
see sums, averages, etc., choose Summary and set the summary options. Click the Next button.
• Type a name for the query (e.g., Contacts Mailing Address) in the What title do you want for your query? field.
(Leave the Open the query to view information radio button turned on).
Queries are not confined to just a single table. You can create a query that runs against multiple fields in multiple tables. This query is created in an
identical manner to the single-table query defined on the previous page. The only difference when creating a multiple-table query is that after
selecting the fields in one table, as we saw in the last example, you then select the next table and choose additional fields.
In this query, we will ask for the name, contact type, and phone number of all records in the Contacts table. When we create the query, we will select
fields from two tables: Contacts table (Last Name, First Name, and Work Phone fields) and Contacts Type table (Contact Type field).
- 49 -
• From the Available Fields, select the fields to be included from this table (e.g., Last Name, First Name, and Work Phone).
• Select the next tables or query from the Tables/Queries drop-down list and pick the fields in that table in which you would like to perform
the query.
• Type a name for the query (e.g., Contacts by Contact Type) in the What title do you want for your query? field.
Throughout this lesson, we have learned several different ways to quickly locate information in the Contact Management database: sort records
(lesson 12), find records (lesson 13), filter records (lesson 14), and queries. Can you run a query and then sort, find, or filter records? Absolutely.
This is the power of a database.
Everything that you previously learned about how to save sorts and filters applies to queries as well. Once a query is defined, you can come back into
the database at any time -- even after new contact records have been added -- and run that query.
After you run a query and defined a sort, you will be asked to save the sort and the query design when you close the query or exit Access. If you save
those changes, the sort will be saved to the query the next time you run the query. If you do not save the changes, the query returns to the original
order the next time you run it.
- 50 -
When a filter is applied to a query, Access will ask if the changes to the query design are to be saved the next time you close the database or exit
Access.
• An answer of yes will save the filter but not the filtered query. The next time the query is run, all records that match the query are visible.
• To apply the saved filter, click the Apply Filter button to reapply the filter. Remember, Access saves only the last filter you create.
Challenge!
o Select the following fields in the Contacts table: Last Name, First Name, Company Name, Work Phone, and Work Extension.
o Select the following fields in the Calls table: Call Date, Subject, and Notes.
o Select a Detail query.
o When prompted to name the query, call it "Job Search Progress."
• Build onto the Sorting, Finding, and Filtering capabilities learned in previous lessons by applying these techniques on the queries that you
have created in this Challenge!
• Close the Contacts table, and if displayed, click the NO button in response to the Do you want to save changes to the design of table
'Contacts'? system prompt.
- 51 -
Lesson 16: Running and Printing Database Reports
Objectives
The Contact Management database contains two reports that you can use to print a complete list of contacts in the database (Alphabetical Contact
Listing Report), as well as a call log to recap phone-call summaries made between any two dates (Weekly Call Summary Report).
• On the Main Switchboard form, click once on the Preview Reports menu selection.
• On the Reports Switchboard, click once on the Preview the Alphabetical Contact Listing Report menu selection.
The Contact Management reports can also be run in Datasheet View by selecting the Reports tab from the Object palette of the database
window. Then double-click on the Alphabetical Contact Listing report.
- 52 -
To run the Weekly Call Summary Report:
• On the Main Switchboard form, click once on the Preview Reports menu selection.
• On the Reports Switchboard, click once on the Preview the Weekly Call Summary Report menu selection.
• In the Weekly Call Summary dialog box, type the date range in the Begin Call Date and Ending Call Date fields. This lets you search the
database for calls made between two defined dates.
The reports object in Access allows you to create a report to present your data in a meaningful and attractive printout. One way to create a report in
Access is to use AutoReport. This report format quickly generates a columnar or tabular report format for records in a selected table.
To Create an AutoReport:
• Open the database window and choose the Reports selection from the Objects palette.
• Click the New button to open the New Reports dialog box.
• Choose either the AutoReport: Columnar (prints one record in columnar format) or the AutoReport: Tabular options (prints all records
in tabular format.)
- 53 -
• Click the drop-down list and choose the table or query on which the report or query is based.
• Click the OK button to create the report and open it in Print Preview. (The mouse pointer changes to a magnifying glass. Remember, you
cannot edit data in Print Preview.>
- 54 -
After you have created a report, you will be asked to save the report when you close it or exit Access. When you save a report, only the structure
of the report is saved and not the underlying data seen in print preview.
Another way to create reports in Access is to use the Report Wizard. The Report Wizard asks a series of questions that you must answer. Access
uses your responses to create the report.
• Open the database window and choose the Reports option from the Object palette.
• Click the New button to open the New Reports dialog box.
• Click on the Report Wizard selection.
• Click the drop-down list and choose the table or query on which the report or query is based.
- 55 -
• Choose the table or query in which you would like to base the report.
• Highlight the first field from the Available Fields that will be included in the report and click the right arrow to move the field to the
Selected Fields box.
• Repeat so that each field is included in the report, or the click the double arrow to move all the fields for the report.
• When finished, click the Next button.
In the Report Wizard's second dialog box, you can select a field name for grouping purposes. For example, by selecting First Name, notice how First
Name becomes the group header (blue text) in the right side of the picture. You do not have to select any grouping levels.
• Highlight the field that you would like to use as a group level, and click the right arrow to move the field to the Selected Fields box.
• When finished or to bypass this screen, click the Next button.
In the Report Wizard's third dialog box, you can specify how or if the reports are to be sorted on the report. For example, if you wanted to show
names alphabetically and by state, you would first sort by State and then by Last Name.
- 56 -
• In the first field (optional), select a field name from the drop-down box only if records in the report are to be sorted by that field. Then,
click the button to define whether records are to be sorted in ascending or descending order.
• If necessary, repeat for each of the remaining three sort fields.
• When finished or to bypass this screen, click the Next button.
• Select one of the three listed Layout options: Columnar, Tabular, or Justified.
• Select an Orientation for the report, either Portrait or Landscape.
• (Optional), select or deselect the Adjust the field width so all fields fit on a page field.
• Click the Next button to continue.
- 57 -
• Click through the different format options displayed on the screen -- Bold, Casual, Compact, etc., to display a picture of each report format
on the left side of the wizard screen. Highlight the desired format you would like to use.
• Click the Next button to continue.
• Assign a name to the report by typing a file name in the What title do you want for your report? field.
• Click the Finish button to complete the wizard and generate the report.
You can decide to include any or all of the Report Wizard's selections in your report.
Very Important! When working in tables, forms, queries, and reports, use the New Object button on the toolbar to create new database objects
(tables, forms, queries, reports).
- 58 -
When your report opens in Print Preview, it is usually displayed at 100%. However, to get a better look at various report features, you may need to
resize your window.
• In Print Preview, your mouse pointer is the Zoom tool (magnifying glass), which allows you to "zoom" in and out. Click on the document
(or the Zoom button on the toolbar) to "zoom" in for a closer look. Notice Print Preview's drop-down menu reads "100%."
• Click again on the document (or the Zoom button) to "fit" the document to the Print Preview window.
• Use the Resize drop-down menu to further resize your document.
• Click the Database window button to bring the database window to the front.
• Click the Officelinks button to "Publish it with Word" or "Analyze it with Excel". Clicking either of these choices will allow you to
print your document as a Word or Excel document.
Printing a Report
Any report in the Contact Management database can be outputted to a printer of your choice.
• Click the Print button on the Print Preview toolbar to print your document (the Print dialog box will not open).
- 59 -
• Choose File Print from the menu bar to open the Print dialog box.
• Make any necessary changes to the Print Range, Copies, or Zoom sections of the Print dialog box.
Print Preview and Print are fully explained in the Office 2002 XP course.
Challenge!
- 61 -