Você está na página 1de 104

MICROSOFT ACCESS 97

INTRODUCTION

Training manuals provided by Knowledge Alliance Austin 2113 Wells Branch Pkwy #500A Austin, Texas 78728 (512) 989-8558 (512) 989-8580 fax

Introduction

Preface
FutureTech Training, Inc. (FTT) prepared this manual for use in the area of Training and Development for continuing education. It is intended that these materials will be used to assist students in the learning process during the class, after the class to review, and continued learning as a reference guide. This manual is NOT intended to replace the Users Guide Manual that is provided by the company with the software. This training manual was prepared using Microsoft Word 97, and Windows 95. The master copy was printed to disk using the Adobe Acrobat PDF program.

ACKNOWLEDGMENTS Primary Course Developers: Russ D. Peterson, Jr. Kevin J. Karschnik

Copyright Notice
Copyright 1997 by FutureTech Training, Inc. All Rights Reserved. 040798 This publication, including the student manual, diskette, quick reference cards, and FTT Productivity Tracking, or any part thereof, may not be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, storage in an information retrieval system, or otherwise, without the prior written permission of FutureTech Training, Inc., 1106 Clayton Lane Suite 105E, Austin, TX 78723, (512) 459-0715.

Disclaimer
While FutureTech Training, Inc. makes a sincere effort to ensure the accuracy and quality of these materials described herein, all material is provided without warranty, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. FutureTech Training, Inc. disclaims all liability for any direct, indirect, incidental or consequential, special or exemplary damages resulting from the use of this product or the products described in this manual.

Trademark Notices
FutureTech Training, Inc., FTT, and the FutureTech Training, Inc. logo are registered trademarks of FutureTech Training, Inc. Microsoft and Windows are registered trademarks of Microsoft Corporation. All other product names and services identified throughout this book are trademarks of their respective companies. No such use is intended to convey endorsement.

TEAMTech is a national partnership between United Way of America, IBM, Americorps*VISTA and Public Allies. The goal of the project is to develop strong

TEAMTech Austin

Page 2

Introduction
leadership and technological skills among non-profit organizations. Austin is one of twelve cities participating in the project. Americorps*VISTA volunteers go into the community to help enhance human service agencies competency in technology through different avenues, such as computer software training and the installation of donated computer equipment. This is the second year of the TEAMTech Austin project. Last year TEAMTech Austin focused on a pilot project, creating an Information and Referral database network called InfoLink. The closed InfoLink Network was made available to non-profit agencies to help facilitate collaboration between agencies, and to make the agencies more effective at distributing information to the public. This year the United Way Capital Area plans to expand the InfoLink pilot project by putting it on the World Wide Web. It is our hope that this will make agency information more easily available and accessible to the public. In addition, our goal for this year is to provide Microsoft Access training to non-profit agencies in order to gain an increased knowledge of the software to better use it. Also, TEAMTech members will provide assistance to agencies developing a technology plan to sustain their agencies into the next millennium. We will fulfill this goal partly through the creation of a technology resource manual.

TEAMTech Austin

Page 3

Introduction

Introduction
Welcome How to Use This Manual
The purpose of this manual is to make your software application easier to understand so you can apply the information to your work. The following terms and symbols will help you identify specific sections of this book.

LESSONS

The bold, italicized, large print at the introduction of each chapter represents a new topic. Each training guide is divided into several lessons for easy reference after class. Each lesson is divided into many topics that are labeled by a bold, italic heading. These are to assist you during and after class to find specific topics on the subject matter. Subtopics are also bold and italic and will be found within each topic to emphasize the information inside the main areas.

Topic Headings

Subtopics

Exercises
session.

The smile symbol throughout the book refers to an exercise to be done in class or during a practice

Warning
watch out for in your work.

This symbol indicates a pitfall or warning for you to

Glossary

The glossary found at the end of this manual is a collection of terms and definitions from this book.

TEAMTech Austin

Page 4

Table of Contents

Table of Contents
Lesson One: Getting Started In Access........................................................ 9 Course Objectives .................................................................................. 10 What is Access?..................................................................................... 11 Start Access ........................................................................................... 13 The Access Interface.............................................................................. 14 Understanding Database Terms............................................................. 16 Create a Database with the Database Wizard ....................................... 17 Creating a New Database from Scratch ................................................. 21 Lesson Two: Working With Tables ............................................................... 23 Create a Table........................................................................................ 24 Field Data Types .................................................................................... 26 Set the Primary Key................................................................................ 28 Table Wizard vs. From Scratch ........................................................... 29 Enter Data .............................................................................................. 32 Modify the Table Design......................................................................... 35 Define Table Relationships .................................................................... 37 Edit Data in a Table................................................................................ 40 Edit Data With the Zoom Box ................................................................. 42 Use AutoCorrect to Edit Data ................................................................. 43 Lesson Three: Locating Records .................................................................. 45 The Find Feature.................................................................................... 46 Sort Data ................................................................................................ 48 Filter the Data......................................................................................... 51 Filter by Form ......................................................................................... 52 Filter by Selection................................................................................... 53 Save a Filter as a Query......................................................................... 54 Lesson Four: Forms in Access...................................................................... 55 What is a Form? ..................................................................................... 56 The Form Wizard ................................................................................... 57 Use a Form to Locate Records............................................................... 60 Change the Design of a Form ................................................................ 61 Use AutoFormat with Forms ................................................................... 64 Lesson Five: Querying Data .......................................................................... 65 What is a Query? ................................................................................... 66 Use the Dynaset to Edit Data ................................................................. 70 Use an Expression as Criteria................................................................ 71 Save the Query Object ........................................................................... 73 Perform Calculations with a Query ......................................................... 74 Grouping and Totals of Queried Data .................................................... 75

TEAMTech Austin

Page 6

Table of Contents Query Several Tables............................................................................. 76 Lesson Six: Reporting the Data..................................................................... 79 What is a Report? .................................................................................. 80 The Report Wizard ................................................................................. 82 Customize the Report............................................................................. 85 Preview and Save a Report.................................................................... 87 Lesson Seven: Importing Data ...................................................................... 89 Import Data from Microsoft Excel ........................................................... 90 Exit Access ............................................................................................. 92 Index................................................................................................................. 93 Glossary........................................................................................................... 95

TEAMTech Austin

Page 7

Lesson One: Getting Started in Access

Lesson One: Getting Started In Access


1. Course Objectives 2. What is Access? 3. Starting Access 4. The Access Interface 5. Understanding Database Terms 6. Creating a Database with the Database Wizard 7. Creating a New Database 8. Creating a Table 9. Field Data Types 10. Table Wizard vs. from Scratch 11. Entering Data 12. Modifying the Table Design 13. Defining Table Relationships

TEAMTech Austin

Page 9

Lesson One: Getting Started in Access

Course Objectives
This course was designed for the user who has fundamental experience in Windows 95.

Before Class
All students participating in this course should be familiar with the basic operations of Windows 95 and the use of a mouse.

After Class
Upon successful completion of this course the student will be able to complete the following objectives:

Identify the parts of the Access screen Create a Table Object in a Database Identify Data Field types Enter and Edit data in a Table Set a Primary key for a Table Define Table relationships Filter / Sort / and Find records Create and Use a Form Create and Use a Query Create and Customize a Report Import data from Excel

TEAMTech Austin

Page 10

Lesson One: Getting Started in Access

What is Access?
The function of a database is to store and retrieve information in an efficient manner. The most common example of a database is an address book used for storing names, addresses, and phone numbers. The address book is an example of a flat database. A flat database is one in which all of the information is stored in one file. With a flat database, it is necessary to enter the same information repeatedly throughout the entire database. Microsoft Access, on the other hand, is an example of a relational database. The relational database is more complex than a flat database because all the information is stored in multiple files. All relational databases are based on the concept of storing information without duplication. In a relational database, it is only necessary to make changes in one place, and then all other areas adjust accordingly.

TEAMTech Austin

Page 11

Lesson One: Getting Started in Access A relational database stores all information in multiple database files. Each database file contains different pieces of information. For example, one database can hold customer information, while sales information is in a second database, and product information is in a third database. By placing information in separate database files, there is an elimination of the need for redundant data entry. The Customer, Inventory, and Products database files are connected to each other through a common field. This connection is called a join and creates a bridge for Access to use for pulling information for search requests. The example below shows how three database files connect by a common field.

The Customer and Products databases join through the Customer ID Number field. The Inventory then joins to the Products database through the Inventory Code field.

TEAMTech Austin

Page 12

Lesson One: Getting Started in Access

Start Access
To start Access 97 from Windows 95, go to Start / Programs / Access.

Start Access
1. Go to Introduction Folder on your desktop 2. Double-click on Lesson1 to select todays class database 3. Access will load the database

TEAMTech Austin

Page 13

Lesson One: Getting Started in Access

The Access Interface


The parts of the screen in Access are identical to many of the standard parts of the screen that seen in other Microsoft applications. Title Bar: The title bar is located at the top of open windows. Active and inactive windows have differently colored title bars. Use the title bar for maximizing and restoring a window with a double-click and for moving a window by dragging it on the screen.

Control Menu Icon: The control menu icon appears in the upper left-hand corner of open windows. There are two different types of control menus in Windows 95: one for the active application and one for each of the documents. Use the control menu icon to close a window by double-clicking on it. Menu Bar: The menu bar appears directly below the title bar. The menu bar houses all the menus that needed to operate in the current window. Access the menus by clicking the desired menu or by using the ALT key combination with the appropriate underlined letter.

Minimize, Maximize, Close, and Restore: These buttons appear in the upper right hand corner of the screen. The Minimize button reduces a window to an icon.

The Maximize button enlarges a window to take up as much space as allowed, usually the whole screen.

The Restore button returns a window to its previous size.

The Close button closes the open window.

TEAMTech Austin

Page 14

Lesson One: Getting Started in Access Scroll Bars: The scroll bars appear on the right and bottom of the screen. These bars are for moving around the screen. There are several ways to scroll: click the scroll arrows, click inside the scroll bar, or drag the scroll box.

The Database Window: When a database opens in Access, it opens into the Database Window. This window contains all of the necessary objects for the creation of a functional, relational database. Navigate to this window at any time with the F11 keystroke.

Toolbars: The toolbars in Access provide a quick method of utilizing features by eliminating the need to always use the menu bar. The toolbar changes frequently in Access, depending on the view and object that currently in use. The toolbar pictured below is the standard toolbar in the database window.

Status Bar: The status bar located at the bottom of the screen displays important information. Before the creation of a database, Access will be waiting in the Ready mode.

TEAMTech Austin

Page 15

Lesson One: Getting Started in Access

Understanding Database Terms


The database terminology used in Access differs somewhat from that used in other databases. Object Tables, Queries, Forms, Reports, Macros, and Modules are all termed objects. Each object stores different types of information used in the database. The Table is the seed level of all data in the database. All data information is stored in the Table. This is the first type of object created in a new database. A Query is an inquiry into the data. A Query allows the user to ask a question of the data. Access provides an answer. A Form is generally used to look at one record at a time on the screen. Forms are used for easy data entry. A Report is an object that places the data in a presentable format for printing to paper. View Reports on screen or printed to paper. A field is the smallest unit of information in a database. The first name of a customer is an example of a field entry. A record is the sum of all fields for one client, person, product, etc. In a Table, one record is one row of the Table.

Table

Query

Form

Report

Field

Record

Database A database in Access is the sum of all objects in the database window. The entire database is saved as one file with an extension of MDB, which stands for Microsoft Database.

TEAMTech Austin

Page 16

Lesson One: Getting Started in Access

Create a Database with the Database Wizard


Access offers many Wizards to help in the creation of new databases, Tables, Forms, and etc. The Wizards asks questions and then use the answers given to automatically build whatever was requested. Users are encouraged to use Wizards for the creation of new objects. To create a new database with a Wizard, select File / New from the menu bar, or click on the New Database button. The New Database button looks like a blank piece of paper.

Create a New Database Using a Wizard


1. Click the New Database button 2. In the New dialog box, select the Databases tab 3. Next, double-click the Address Book icon

4. Give the file your last name, and click Create

TEAMTech Austin

Page 17

Lesson One: Getting Started in Access 5. When the following dialog box appears over the Database window, click Next

6. Add Childrens Names to the list of fields in the Table. Select, Yes include sample data (including sample data can assist in learning to use the database more quickly).

TEAMTech Austin

Page 18

Lesson One: Getting Started in Access 7. Click the Next button to move to the next step 8. For the screen display, choose International, and click Next

9. Choose the Bold Report style, and click Next 10. Name the database Addresses, and click Next

TEAMTech Austin

Page 19

Lesson One: Getting Started in Access 11. Choose the option for starting the database after the Wizard builds it, and click Finish 12. View the Address Book

TEAMTech Austin

Page 20

Lesson One: Getting Started in Access

Creating a New Database from Scratch


To create a database from scratch, select File/New from the menu bar, or click the New Database button on the toolbar. These are the same steps taken to use the Database Wizard. Then, choose Blank Database from the General tab. Following this command, Access asks for a name for the database. The name of the database should reflect all of the objects that will be contained in the database. This file name could be as simple as the name of a company.

Create a New Database


1. Close the Lesson1 database if necessary 2. Click the Blank Database icon, and click OK 3. Type Projects for the name of the database 4. Select the C: drive from the list of drives then OK 5. Notice how Access creates an empty database window

TEAMTech Austin

Page 21

Lesson Two: Working With Tables

Lesson Two: Working With Tables


1. Create a Table 2. Field Data Types 3. Set the Primary Key 4. Table Wizard vs. "From Scratch" 5. Enter Data 6. Modify the Table Design 7. Define Table Relationships 8. Edit Data in a Table 9. Edit Data With the Zoom Box 10. Use AutoCorrect to Edit Data

TEAMTech Austin

Page 23

Lesson Two: Working With Tables

Create a Table
The first step in creating any database is the creation of Tables. Each Table consists of rows and columns. The fields (columns) of the Table are defined during the creation of the Table. The fields need to reflect the types of information to be collected about each entry, such as product, order, etc. Prior to creating the Table it is a good idea to plan out the strategy for the Table, and for the entire database. The planning stage of the creation process should receive ample attention without dominating the entire project. It is difficult to plan out the perfect database. Plan out as much as possible, but be aware that Access makes it easy to make changes to the database later, if necessary

Rules for Table Creation Design the Table to contain information about only one type of data (donors, corporate sponsors, donations, and etc.). Designate a Primary Key to identify each record individually. This key should never have a duplicate entry. A counter field works nicely as an arbitrary key. Avoid redundancy in field creation. If the Contact name is in the Donor Table, do not place a Contact name field in the Donations Table. Avoid repeating fields like item 1, item 2, item 3. A sub-form object can take the place of these fields.

TEAMTech Austin

Page 24

Lesson Two: Working With Tables

Table Views
There are two options available for viewing Tables, the Datasheet view and the Design View. When viewing Tables, toggle between the two views by clicking the Datasheet view button or the Design view button. Datasheet View: The Datasheet view is a window that displays data from a Table in a row and column format. The Datasheet view is where the user edits fields, adds and deletes data, and searches for data. Click the Datasheet view button to change to the Datasheet view.

Design View: The Design view is where the Table layout is designed. Click the Design view button to change to the Design view.

TEAMTech Austin

Page 25

Lesson Two: Working With Tables

Field Data Types


Each field in a Table is defined as a certain type of data. For example, the name of a company would be considered a Text field.

The following Table defines the field types used in Tables within Access. Field Type Text Description Holds up to 255 characters of information. Input can be both alpha and numeric Holds up to 64kilobytes of information. Used to store large amounts of text as a memo. Numeric values of 1, 2, 4, or 8 bytes Dates and times of 8 bytes can be used in calculation Monetary values up to 8 bytes in length Numeric value automatically incremented by Access for each record added Boolean values, one bit in length, used for true / false fields OLE objects from other applications up to 1 Gigabyte in length Email addresses, Internet URLs Example Company Name, Address, Phone Number Notes field in a customer Table Quantity Sold or in Inventory Date of sale Price Customer ID, Order Number, PO Number Invoiced, Health Plan, Mailing List Picture of the employee, picture of the product TEAMTech@uway-austin.org

Memo

Number Date / Time Currency Auto Number

Yes / No

OLE Object

Hyperlink

TEAMTech Austin

Page 26

Lesson Two: Working With Tables

Define the Following Types of Data


Field Name 1. Inventory Code 2. List Price 3. Item Description 4. Quantity in Stock 5. Phone Number 6. Employee ID 7. Full Time or Part Time 8. Product Photo 9. Customer Notes 10. Last Name Data Type

TEAMTech Austin

Page 27

Lesson Two: Working With Tables

Set the Primary Key


The Primary Key is the field whose value or values uniquely identifies each record in a Table. In a relationship, the Primary Key refers to specific records in one Table from another Table. The Primary Key field can not be duplicated in the Table. Because of this, the unique ID field in a Table is often set as the Primary Key. For example, the last name field cannot be set as the Primary Key since there may be more than one Jones, or Smith. The Primary Key also gives Access a method of uniquely identifying, locating and relating records from separate Tables since the Primary Key has no duplicates in a Table. Set a Primary Key Setting this key is done from the design view of the Table. After activating the field to be set as the Primary Key, click the Primary Key button on the toolbar. If a field is set as the Primary Key in a Table that already contains data and Access locates duplicates, it will display a warning that will disallow the key.

Set Multiple Primary Keys It is possible to set more than one field as the Primary Key. This instructs Access that together, the two fields need to be unique. For example, setting the Last name and the First name as the multiple Primary Keys means that no two records can have the same First and Last name. Set the multiple keys by selecting all of the fields while holding down the CTRL key, and then click the Primary Key button.

TEAMTech Austin

Page 28

Lesson Two: Working With Tables

Table Wizard vs. From Scratch


Access makes it possible to create a Table with the Table Wizard or to start from scratch. Depending on how much planning occurred prior to creation, the choice will vary. Access 97 uses a revamped Table Wizard that creates Tables automatically. Databases created with the Database Wizard do not require Table creation. The Table Wizard If there is not adequate time or resources to plan out the types of fields desired in the database, it may be a wise choice to use the Table Wizard as a starting point. By clicking on the New button in the Database Window while viewing the Table objects, Access asks if the user wants to use the Wizard or to create a Table from scratch. The Wizard suggests fields based on the type of Table being created. If allowed, Access also sets the data types, field properties, and the Primary Key. The Primary Key is discussed fully later in Lesson Two.

Create a Table with Table Wizard


1. On the Table tab click the New button 2. Click the Table Wizard button 3. Select the Projects Sample Table 4. Double click the four fields shown in the picture below 5. Click the Next button to move to the next step

6. Name the Table Projects and let Access set the Primary key

TEAMTech Austin

Page 29

Lesson Two: Working With Tables 7. Click Next to move to the next step

8. Select the Modify the Table design option, and click Finish 9. An example of how the Table should look appears below

10. Switch to the Datasheet view of the Table 11. Close the Table after viewing

TEAMTech Austin

Page 30

Lesson Two: Working With Tables

Start from Scratch


If all of the fields are planned out, then it may be beneficial to create a Table from scratch. Access provides a blank Table grid for defining fields and data types and properties. Creating a Table from scratch can be faster than using the Wizard when the user is familiar with the data types and field properties.

Create the Following Table


1. Click the New button while viewing the Table objects 2. Select the Design View in the New Table dialog box that appears next 3. Type the field names, data types, and descriptions, so your computer will look like the picture in the book 4. Click Once on Product ID 5. Click the Primary Key button to make Product ID the Primary Key 6. Save the Table, and name it Projects 7. Switch to the Datasheet view

TEAMTech Austin

Page 31

Lesson Two: Working With Tables

Enter Data
Enter data in Access from three different locations: the Table Datasheet View, the Forms, and the Query Dynasets. Remember that when entering data in any of these locations, the data is actually placed in the underlying Table. Add new records by clicking the New Record button on the toolbar. In the datasheet view, the following keystrokes are helpful for editing and navigating in Access.
Data Entry Short Cuts Ctrl + ; Current Date Ctrl + : Current Time Ctrl + Alt + Space Default field value Ctrl + Prev. field value Ctrl + Enter New line in field Ctrl + plus sign Add a new record Ctrl + minus sign Delete record Shift + Enter Save Record Spacebar Toggle check box Navigating Keystrokes in a Datasheet Ctrl + Home First Field in First Record Ctrl + End Last field in last record End Last field in current record Home First cell in current record End in text box End of current line Home in text box Beginning of current line Tab, or Right Arrow Next Field Shift + Tab Previous Field Right and Left Arrow Next and Prev. field Up and Down Arrow Prev. and Next record Pg Up Up by one screen Pg Dn Down by one screen Ctrl + Down Arrow Current field in last record Ctrl + Up Arrow Current field in first record Ctrl + Pg Up Right one screen Ctrl + Pg Down Left one screen

The symbols pictured below are seen during data entry in Access. Each symbol represents the current status of the record.

Current Record New Record

Edited and Un-saved Records

Add a New Record

TEAMTech Austin

Page 32

Lesson Two: Working With Tables Navigate with the Mouse It is possible to navigate in the Datasheet view by using the mouse. The movements in an Access datasheet are similar to the navigation movements in an Excel spreadsheet. In the Datasheet view of the Table objects, scroll through the records using the scroll bars and use the navigational buttons located at the bottom of the window. Use these buttons to go quickly to a record in the Table.

Save Records Access saves data during entry record by record. If data is edited in a field and then moves off of the record by clicking or pressing the up or down arrow, Access automatically saves the changes to the record. If there is ever any doubt as to whether the current record is saved or not, look for the symbol to the left of the record. The symbols on the previous page explain the status of the record. Without moving off of the record, save the changes to the record by pressing the keystroke SHIFT + ENTER. This instructs Access to save the changes to the record.

Navigate in a Table
1. Close down the Projects Database we created 2. Open the Table named Donors in the datasheet view 3. How many total records are there? 4. Navigate to record number 332

TEAMTech Austin

Page 33

Lesson Two: Working With Tables

Enter Records in a Table


1. Click on the new record button 2. Enter the records listed below 3. Press Shift + Enter to save the last record

Donor ID 1508 1509 1510

Company Name Slate & Sons Acme, Inc.

Contact Person John Slate W. E. Coyote

City Austin Austin

Street Address 451 Bedrock Way 333 Desert Ave. Your Information Here

State TX TX

Zip Code 78700 78700

Phone Number 512-555-0023 512-555-4818

TEAMTech Austin

Page 34

Lesson Two: Working With Tables

Modify the Table Design


Once the Tables are defined in the database, there may be a need to insert more fields, rename certain fields, or to change the properties associated with the fields. Make these changes from within the Design view. If any of the changes are going to affect the data in the database, Access will ask for confirmation. Changing the attributes of the database at the seed level can lead to certain effects in all other objects based on that Table.

WARNING: Access does not make changes to the fields in Forms, Reports, and Queries when a change is made to the Table. These changes must be made manually.

TEAMTech Austin

Page 35

Lesson Two: Working With Tables

Modify the Table Design


1. Open the Donor Table in the Design view 2. Change the Company Name Field to Company 3. Change the State field size from 50 to 2 4. Drag the City field down below the Street Address field 5. Drag the State field down below the City field 6. Save the changes to the Table

TEAMTech Austin

Page 36

Lesson Two: Working With Tables

Define Table Relationships


The backbone of a relational database is the Table relationship. Each Table in the database will most likely be attached to another Table via a common field. The bridge that is created between the two Tables allows Access to pull information from multiple sources to build powerful Forms, Queries, and Reports. Create Relationships Create relationships by clicking the Table Relationship button on the toolbar or by selecting Edit / Relationships from the menu bar. The resulting window allows the user to drag a field from one Table to the field of another. This creates the relationship. Relationships are displayed by the line drawn from one Table to the next. The enhanced Relationship Window in Access 97 allows the user to define relationships between Tables and change any Tables design on the spot. Edit a Relationship If any changes are ever desired, double click on the relationship line to access the relationship dialog box. From here, make any necessary changes, and then click OK to apply them.

Delete a Relationship Delete relationships by clicking on the relationship line and then pressing delete on the keyboard. If Access cannot delete the relationship, it displays a dialog box and gives the reason. WARNING: Deleting a relationship could severely affect Forms, Queries, and Reports in the database if they rely on data fields from the connected Tables. Enforce Referential Integrity TEAMTech Austin Page 37

Lesson Two: Working With Tables This option tells Access that no record in any Table should exist if there is not a corresponding record in the related Table. For example, if one Table includes the employee general information and the other Table contains the detailed information on their pay structure, it may be a good idea want to enforce referential integrity. This would prohibit an employee from existing without a pay structure, and it would prohibit a pay structure from existing without a related employee record. Referential Integrity can only be enforced on two fields that have the same data type---for example, text and text, or number and number.

Create a Relationship
1. From the database window, click the Relationships button 2. Notice the relationship set up 3. Double click the joining line 4. Notice the relationship type, and then click OK 5. Drag Fundraiser ID from the Projects Table to the Donations Table (drop it on Fundraiser ID) 6. Click Create to create the relationship 7. Click on Referential Integrity 8. Close down the Relationships window and save the layout

TEAMTech Austin

Page 38

Lesson Two: Working With Tables

More Practice with the Primary Key


1. Open the Donations Table in Design view 2. Click on the Donation Date 1. Hold down CTRL and click on Donor ID Number 2. Click on the Primary Key button on the toolbar 3. Notice the key symbol to the left of the field 4. Save the changes and notice the errors (there are duplicates) 5. Click OK to get past the error dialog boxes 6. Hold down CTRL and click on Fundraiser ID 7. Click on the Primary key button on the toolbar 8. Close and Save the Table

TEAMTech Austin

Page 39

Lesson Two: Working With Tables

Edit Data in a Table


Data can be edited at any time, and the changes are made to the underlying Table and are saved record by record. It is possible to edit chosen data from the Datasheet view of the Table, from a Form view object, or from a Dynaset resulting from a select Query. When editing data, toggle between the Edit mode (mouse) and the Navigate mode (keyboard) by pressing the F2 function key. Other editing keystrokes are found in Lesson One of this manual.

TEAMTech Austin

Page 40

Lesson Two: Working With Tables Undo The Undo feature of Access works the same as it does in other Microsoft applications. The Undo feature will only undo the last action performed. It will not undo changes performed on multiple fields in a record when each field was edited one-by-one. Undo Field/Record The Undo Record feature will undo any and all changes made to any fields in the current record. This feature cannot undo changes to a record if the record has been saved.

Edit the Data


1. Open the Donor Table in the datasheet view 2. Navigate to Donor number 1003 3. Add Inc. to the end of Edgewater Tours 4. Navigate to Donor number 1006 5. Change Williams first name to Bill 6. Navigate to Donor number 1011 7. Change the state of MD to ND (North Dakota) but do not move off of the record 8. Click the Undo Record / Field button 9. Navigate to Donor number 1019 10. Change Flexibility Co. to Flexibility, Inc. 11. Change the contact name to John Houser 12. Press Shift + Enter to save the changes to the record 13. Click on the Undo button

TEAMTech Austin

Page 41

Lesson Two: Working With Tables

Edit Data With the Zoom Box


The contents of a field in the datasheet view can be difficult to read and edit when the amount of data surpasses the width of the column. To compensate for that, Access has incorporated the Zoom Box which allows the user to edit the contents of a field in a larger window. Access the Zoom Box feature by using the SHIFT + F2 keystroke. The resulting dialog box displays a much larger text area for editing. The Zoom Box can also be helpful for creating Expressions in a QBE grid. When exiting the Zoom box, editing changes for this field are not saved in the record, it is necessary to move off of the record or to press SHIFT + ENTER to save.

Edit Data with the Zoom Box


1. Navigate to the first record with CTRL + Home 2. Move to the last column with the End key 3. Press the keystroke SHIFT + F2 4. Press CTRL + Home to move to the top of this field 5. Add the word Additional to the first line of text then OK 6. Press the keystroke SHIFT + ENTER to save the record

TEAMTech Austin

Page 42

Lesson Two: Working With Tables

Use AutoCorrect to Edit Data


Access 97 includes AutoCorrect which allows Access to monitor typing. Use AutoCorrect to automatically correct frequently mistyped text and to automatically replace abbreviations with long names. Access will correct the error after the spacebar is pressed. To Use the AutoCorrect feature, go to Tools / AutoCorrect. Next, select the Replace Text As You Type check box. In the Replace box, type the text to be corrected automatically. Then, in the With box, type the corrected text, and click Add.

To see how this feature works, type teh. AutoCorrect will change the word after the spacebar is pressed.

TEAMTech Austin

Page 43

Lesson Three: Locating Records

Lesson Three: Locating Records


1. The Find Feature 2. Sort Data 3. Filter the Data 4. Filter by Form 5. Filter by Selection 6. Save a Filter as a Query

TEAMTech Austin

Page 45

Lesson Three: Locating Records

The Find Feature


The Find feature in Access locates records that match specified criteria. This feature is most often used in a Datasheet or Form view of a Table. Access the Find dialog box by selecting Edit / Find from the menu bar or by clicking the Find button on the toolbar. This feature locates records, but it does not replace the found data with other data. To perform a find and replace, use an action Query.

Before entering the Find dialog box, it is usually wise to activate the field to be searched. This makes it possible to select the Search Only Current Field option in the Find dialog box. Narrowing the search down to one field decreases the amount of time it will take to find text. Search In Current Field Choose for Access to search only the current field or all of the fields in the Table. Instructs Access where to begin searching: above or below the current record in the Table or all of the Table. Access will find the text only if it matches the case. Tells Access to find the text only if it is formatted the same as what is typed in the Find What text box. For example, dates are stored as numbers but may be displayed as 5 Jan 92. Select the match type for the searchpart of field, the whole field, or the start of a field.

Search

Match Case

Search Fields as Formatted

Match

TEAMTech Austin

Page 46

Lesson Three: Locating Records

Locate Records with the Find Feature


1. Open the Donor Table 2. Press Tab twice to enter the Contact Name field
Make sure your cursor is in the Contact Name field- this is the field that the find feature will search!

3. Click on the Find button on the toolbar 4. Type in the name Susan 5. Select Any Part of Field from the Match list 6. Click on the Find Next button 7. Notice how Susanna is also found 8. Click Find Next until you reach the end of the records 9. Click OK once you reach the end of the records

TEAMTech Austin

Page 47

Lesson Three: Locating Records

Sort Data
All data in Tables can be sorted according to different fields. When sorting data, it is possible choose to use the Quick Sort buttons on the toolbar to sort according to one field. There is also a Filter / Sort button to create sorts based on more than one field. The default sort for any Table is the order of entry. The only time this changes is if a Primary key has been established in the Table. With a Primary Key set up, this field now becomes the default sort for the Table. Quick Sort After activating the appropriate field in the Table or Form view, click the quick sort button for ascending or descending order. This method of sorting does not allow sorting on more than one key.

Sort the Data with the Quick Sort


1. Close the Donor Table Object 2. Open the Donations Table 3. Notice the records are sorted by date (the Primary Key) 1. Activate the Donation by clicking on it 2. Click on the Sort Descending button on the toolbar 3. Notice the new order of records 4. Close the Table without saving and then reopen the Table 5. Notice the order has returned to its default

TEAMTech Austin

Page 48

Lesson Three: Locating Records Sort on More Than One Field By utilizing the Records/Filter/Advanced Filter / Sort option on the menu, there are more advanced sorts that sort records on more than one field.

The Filter dialog box consists of a window with a list of fields from the Table and a grid in the bottom half of the window. Drag fields from the field list to the grid to determine which fields the Table will be sorted by and the sort order. Fields can also be double-clicked, typed, or selected from the drop down list in the grid at The bottom of the screen.

TEAMTech Austin

Page 49

Lesson Three: Locating Records

Sort by Two Keys


1. Close the Donations if necessary 2. Open the Donors Table Object 3. Notice the sort order 4. Click on Records/Filter/Advanced Filter / Sort 5. Drag the State field to the first column in the grid 6. Double-click the Company field to add it to the grid 7. Set the sort order to ascending for both columns 8. Click the Apply Filter button, and notice the new order 9. To return to the original order, click on Records/Remove Filter/Sort

TEAMTech Austin

Page 50

Lesson Three: Locating Records

Filter the Data


It may become necessary at some time to view a portion of the data in the Table rather than every record. Use the Filter / Sort feature of Access to temporarily eliminate the records which are not to be viewed. For example, as a sales rep, it may be desirable to view only those clients residing in a particular city or state. Placing a criteria in the criteria row of the grid filters out the undesirable data. The filter will remain in effect until the Show All Records button is clicked, or until the Table is exited.

Practice Filtering Data


1. Click on Records/Filter/ Advanced Filter / Sort 2. Add the State field and the City field 3. Sort the City in ascending order 4. Add the criteria of TX for the State field (Access will add the quotation marks) 5. Apply the filter by clicking on the apply filter button 6. Notice the total number of records showing

TEAMTech Austin

Page 51

Lesson Three: Locating Records

Filter by Form
Filtering by Form makes it possible to create a filter by typing the values being looked for in a fill in the blank Form or datasheet. Many people find this feature easier to use than Advanced Filter/Sort. Once the Table, Query, or Form to be filtered is open, click the Filter by Form button on the toolbar. A blank Form or datasheet containing the field names displays. Select the field that will specify criteria that records must meet to be included in the filtered set or records. Select the search value from the dropdown list in the field, and apply the filter. It is possible to specify alternative values that records can have and still make it through the filter by clicking on the Or tab at the bottom of the window and selecting the other value.

Practice Using Filter by Form


1. In the Donor Table, click on the Filter by Form button 2. Click in the City field and choose Austin 3. Choose the Apply Filter button to see your results 4. Click on the Filter by Form button again to add an additional filter value 5. With Austin still highlighted in the City field, click on Or at the bottom of the window 6. Select Charleston and apply the filter

TEAMTech Austin

Page 52

Lesson Three: Locating Records

Filter by Selection
With Filter by Selection, it is possible to specify which set of records is to be worked with by highlighting the search value inside the Form or datasheet. Then, click the toolbar. Once the focus narrows to a specific set of records, narrow it even further by selecting another value from within the subset of records. Filtering by Selection instantly selects the data that matches the current field or selection. Filtering Excluding Selection is similar to filtering by selection; it selects the data that does not match the current field. This is done by rightclicking on the field and choosing Filter Excluding Selection. Suppose there is a record that contains some data that is being looked for. To find other similar records, click in the field containing the desired information and click the Filter by Selection button on the toolbar.

Practice Using Filter by Selection


1. Clear the previous filter 2. In the Donor Table, locate the State field 3. Select a record containing NV by clicking in that field 4. Click the Filter by Selection button on the toolbar and see your subset of data

TEAMTech Austin

Page 53

Lesson Three: Locating Records

Save a Filter as a Query


After applying a filter to the data, it is possible to have access to this filtered data on a regular basis without recreating the filter every time. Since the filter is only temporary, save the filter as a Query object.

By saving the filter as a Query, there is a new Query object available for use at any time. By saving it as a Query object, it also becomes possible to create Forms and Reports based on the Query. Save the filter by returning to the Advanced Filter/Sort window and selecting File / Save Filter as Query from the menu bar.

Practice Saving a Filter as a Query


1. Return to the Advanced Filter/Sort design window if necessary 2. Select File / Save Filter as Query from the menu bar 3. Name the Query object My Nevada Donors, and then click OK 4. Perform the Show All Records action by clicking the Apply Filter button again 5. Close the Donors Table Object 6. Click the Query Objects tab and notice the new object

TEAMTech Austin

Page 54

Lesson Four: Forms in Access

Lesson Four: Forms in Access


1. What is a Form? 2. The Form Wizard 3. Use a Form to Locate Records 4. Change the Design of a Form 5. Use AutoFormat with Forms

TEAMTech Austin

Page 55

Lesson Four: Forms in Access

What is a Form?
Forms are generally used in Access for viewing one record at a time. View more than one record at a time by using a tabular Form or a subform. The Forms in Access and the available design capabilities are heralded in the software industry as the best. The Forms in Access can become quite complex from a design standpoint, and very friendly from an end user standpoint. Forms are normally set up for the end user as a graphical interface for performing data entry. To move from one field to the next in a Form, either press the ENTER or TAB keys. To move backwards through the fields press SHIFT + TAB or SHIFT + ENTER. Navigate to the next or previous record by pressing the Page Down or Page Up keys, respectively. These keystrokes apply only if the Form is one screen or less.

TEAMTech Austin

Page 56

Lesson Four: Forms in Access

The Form Wizard


There are several ways to create Forms in Access. From the Forms Objects tab in the database window, click the New button. A dialog box displays with the choice of using the Form Wizard or other types of Forms. The Form Wizard is highly recommended. The Form Wizard makes it easy to create great-looking data entry Forms in a few seconds. The Form Wizard in Access 97 is more powerful and easier to use than in previous versions. It is now possible to choose fields from multiple Tables or Queries. Before selecting either of these buttons, tell Access upon which Table or Query that it should base this Form.

The Form Wizard is by far the best way to start Forms. Once Access has created the basic layout for the Table, switch to the Design View of the Form to alter the Form to meet the specifications.

TEAMTech Austin

Page 57

Lesson Four: Forms in Access

Create a Form with the Wizard


1. While on the Forms tab, click the New Button 2. Select the Donors Table from the drop down list 3. Click the Form Wizard button 4. Click the double arrow to the right button and then Next 5. Select the Columnar Layout and then Next 6. Select the Pattern style then Next

TEAMTech Austin

Page 58

Lesson Four: Forms in Access

Finish the Form Wizard


1. Add the title Donors Entry Form 2. Select to Open the Form to view or enter information, and then click Finish 3. The Form should match the one pictured below

TEAMTech Austin

Page 59

Lesson Four: Forms in Access

Use a Form to Locate Records


The Form is the most common layout for end users to interface with any database. Once in the Form, it will become necessary to filter, sort, and located records using the Form. In Access 97, Forms automatically inherit filters from their source Tables or Queries. Locate records in the Form with the Find button on the toolbar. Prior to clicking the find button, activate the field in which to search. This will speed up the search process.

Find a Record in a Form


1. Activate the Company field (You must have your cursor in the field that you want to activate)

2. Click the Find (binoculars) button on the toolbar 3. Type Second in the Find What Edit box 4. Select All in the Search list 5. Select Any Part of Field in the Match list 6. Click the Find Next button 7. Click the Close button to exit the Find feature

TEAMTech Austin

Page 60

Lesson Four: Forms in Access

Change the Design of a Form


The design of the Form can be altered to meet any specifications. Access has gained a reputation for its incredible ability to produce Forms and Reports with great ease and flexibility. From within the Form, switch to Design View by clicking the Design View button on the toolbar. The design view is divided into a header, detail, and footer section. Most likely, the area of concern will be the detail section. Header and Footer The information located in these sections only appears at the top and bottom of the Form. This area contains all of the fields from the Table that to be viewed and/or edited.

Detail

TEAMTech Austin

Page 61

Lesson Four: Forms in Access Design View Pointer Shapes The pointer will take on many different shapes when the mouse moves in the design view. These shapes allow different operations to be performed with the fields in the Form. Mouse Description A large flat hand Usage in Form Design Used to move a data field and its label to a new location in the Form. Place the mouse pointer along the edge of a selected field.

A hand with the pointer finger extended Used to move only this field or object to a new location. Place the mouse pointer on the handle in the upper left corner of the selected field An I-beam Used to drop an insertion point for editing text in an object. Place the mouse pointer in the middle of a selected field and then click. Used to resize fields and other objects by clicking and dragging. Place the mouse pointer on top of a resize handle on a selected object.

A bi-directional arrow

TEAMTech Austin

Page 62

Lesson Four: Forms in Access

Change the Design of the Form


1. Click the Design View button on the toolbar 2. Edit the captions for Phone and Zip to match the picture 3. Resize the City, Phone, Zip, Address, and Notes fields to match 4. Drag the fields to new positions to match the picture 5. Save the Form as My Donor Entry Form 6. Switch to the Form View to see the changes

TEAMTech Austin

Page 63

Lesson Four: Forms in Access

Use AutoFormat with Forms


(For References Purposes) To create a Form from scratch, go to the database window and select Form, click the New button, and choose the Design View. At this point, the blank Form is an empty canvas upon which anything can be created. Initially the Form design will have a standard look. To choose a style for the design, click Format/AutoFormat or use the AutoFormat button on the toolbar. It is also possible to use the AutoFormat after the creation of a Form. In the Design View, select Format/AutoFormat or the AutoFormat button, and select the design to be applied to the Form. AutoFormat may also be used with Reports.

TEAMTech Austin

Page 64

Lesson Five: Querying Data

Lesson Five: Querying Data


1. What is a Query? 2. Use the Dynaset to Edit Data 3. Use an Expression as Criteria 4. Save the Query Object 5. Perform Calculations with a Query 6. Group and Totals of Queried Data 7. Query Several Tables

TEAMTech Austin

Page 65

Lesson Five: Querying Data

What is a Query?
The Query capabilities reveal the tremendous power of not only a relational database, but Access itself. The Query provides the user with answers to questions about the data. Queries allow the user to see the desired data in any specified order. It is also possible to perform calculations in data and make global changes to Tables. When faced with a question like this: I would like to see a list of all of our customers in California who purchased more than $1,000 worth of merchandise between the months of July and September of last year, Access can provide a response in a matter of seconds! The resulting data is referred to as the Dynaset for the Query. This dynamic set of data will constantly change based on changes made to the underlying Table. Any changes that are made to the Dynaset will also change the records in the underlying Table.

While viewing the Query objects in the database window, click the New button. The resulting dialog box gives two options: to use the Query Wizard to create one of four types of Queries, or to create a new Query from scratch.

TEAMTech Austin

Page 66

Lesson Five: Querying Data Query Wizard vs. From Scratch The Query Wizard is probably the least useful of the Wizards. It can be confusing at times. It is nice to be able to choose from four Query Wizards, but it may be more efficient to create Queries from scratch. The Four Query Wizards Query Wizards offer an easy way to perform special-purpose Queries. Simple Query Retrieves data from one or more Tables and displays the results in a datasheet where the user can update the records (with some restrictions). It is also possible to use a Query to group records and calculate sums, counts, averages, and other types of totals. Displays summarized values (sums, counts, and averages) from one field in a Table and groups them by one set of facts listed down the left side of the datasheet and another set of facts listed across the top of the datasheet. Determines whether a Table contains duplicate values in one or more fields. Use the results to determine if there are duplicate records in the Table, or to determine which records in the Table share the same value. Finds records in one Table that do not have related records in another Table.

Crosstab Query

Find Duplicates Query

Find Unmatched Query

TEAMTech Austin

Page 67

Lesson Five: Querying Data Once the design of a Query is entered, Access will prompt ask which from which Tables or Queries to pull data. It is possible to pull data from one or more Tables, as long Access can establish a common link between the Tables.

The Query By Example Grid It is possible to create all Queries in Access by using the Query By Example (QBE) grid located in the Design view of Queries. Drag fields down to the QBE grid, double-click them, or select them in the grid from the list box. Field Sort What is the name of the field from the Table? Should data be sorted ascending or descending according to this field? Should this field show up in the Dynaset?

Show

Criteria Is there a criteria as to whether this field shows up in the Dynaset or not?

TEAMTech Austin

Page 68

Lesson Five: Querying Data

Create a One Table Query


1. Click the New button while viewing the Query objects 2. Click Design View, and click OK 3. Select the Donor Table, click Add, and then Close 4. Add the fields pictured below by double-clicking on them 5. Add the criteria of TX to the state column 6. Switch to the Datasheet view of the Query 7. Notice the resulting Dynaset

TEAMTech Austin

Page 69

Lesson Five: Querying Data

Use the Dynaset to Edit Data


The resulting Dynaset of a Query is actually a filtered look at the Table(s) on which it is based. Although it looks and acts like a Table, the Dynaset is actually a dynamic or live view of one or more Tables. The data in the Dynaset can be changed, edited, or deleted, and the these changes are reflected in the actual Table(s) of the database. If several clients have moved to another location, change their addresses by Querying them out of the Table and then making the appropriate changes to the Dynaset. Changes made in the Dynaset are updated in the underlying Tables.

Editing Records in the Dynaset


1. Return to the Design View of your Query 2. Change the state criteria to CA 3. Sort the Dynaset in ascending order according to the company name 4. Run the Query and notice the number of records 5. Delete the Records for Kahn Inc. and Kinders Preschool 6. Return to the Design View of the Query 7. Run the Query again 8. Notice the number of records

TEAMTech Austin

Page 70

Lesson Five: Querying Data

Use an Expression as Criteria


Dynasets will not always be based on a single criteria that matches text to a field. Many Queries will involve comparisons with numbers or dates. Most of these comparisons will entail the usage of expressions. For example, it is possible to see a list of everyone who spent more than $1,000 dollars with a company in a single order. This expression would have a criteria of Selling Price > 1000. The following symbols are used to establish a relationship in the criteria. Algebraic Symbol = > < >= <= <> Relationship Equal to Greater than Less than Greater than or equal to Less than or equal to Not equal to

Wildcards Access recognized three wildcards. The asterisk (*) can stand for zero to multiple characters. The question mark (?) represents one character. The pound symbol (#) represents one digit of a number. Use these wildcards to extract records that meet general criteria. The following examples clarify the results of using wildcards. Wildcard Expression Field Name B* Last Name L?s* Description Result of Query All Last names that start with a B Lisa Lost in Space Las Vegas L5s32-LM All January 30 dates in the 90s

1/30/9?

Date

TEAMTech Austin

Page 71

Lesson Five: Querying Data

Other Criteria Terms


Like Like is the proper syntax for telling Access to look for text or numbers that are similar to the criteria. When typing in criteria using a wildcard, such as the asterisk, Access uses the syntax Like B* (as an example.) This expression is generally used with the term Null. Null means empty, but it does not equal zero. Zero is a value which means neither positive nor negative. The criteria Is Null would extract those records that do not contain any value in that field.

Is

Between Use the between function to establish an inclusive range for the criteria. For example, use it to see all transactions Between 1/1/94 And 12/31/95.

Use Expressions as Criteria


1. Close down the current Query design 2. Click the New button while viewing the Query objects 3. Click Design View and click on OK 4. Add the Donations Table then click on Close 5. Add all of the fields to the QBE grid 6. Add criteria to answer each of the following questions: 7. How many HPIII donations were there? 8. How many donations were over $1,000? 9. How many donations were made between 1/1/92 and 3/1/92? 10. How many HPIII donations over $1,000 were made in December of 1991?

TEAMTech Austin

Page 72

Lesson Five: Querying Data

Save the Query Object


Query objects, once created, can be saved for later use. The Query object names are not limited to eight characters with a three character extension because they are stored in the database file (MDB) created earlier. By saving the Query, it is possible to access the information at a later date, but since the data in the Table may have changed, the resulting Dynaset will also be changed. Most Queries are saved for later usage as the basis for Reports.

Practice Saving a Query


1. From the Design view of the Query, click the diskette button 2. Type in the name My Donations 3. Click the OK button 4. Close the Query design window 5. Observe the new Query object in your database window 6. Open My Donations in the Design view

TEAMTech Austin

Page 73

Lesson Five: Querying Data

Perform Calculations with a Query


Should the need arise, it is possible to add a new field in the Query. This new field may compute a product of two other fields in the Query Table. This field could be the extended price of a product, the gross pay of an employee, or the commission of a sale. By typing in the expression in an available column of the grid, Access will compute the expression and give the result in the Dynaset. When a new field is created in this manner, the field is now available for use in Reports based on this Query. Some common expressions to use in Access: + * \ Add Subtract Multiply Divide

Calculate in the Query


1. Return to the design view of the Query if necessary 2. Delete the Donor ID field from the QBE grid 3. In the first available column type [Donation]+[In-Kind Value] 4. Run the Query and notice the last column 5. Return to the design view by clicking on the design button 6. Delete Expr1 from your new field 7. Type in Extended Price and then Run the Query

TEAMTech Austin

Page 74

Lesson Five: Querying Data

Grouping and Totals of Queried Data


In the resulting Dynaset of a Query, data is filtered only if that particular field includes a criteria in it. This type of grouping can yield computed totals in the Query by department, product number, customer, etc. Group data by a particular field in the QBE grid by turning on the Totals row of the grid. To do this, click the Totals button on the toolbar. The Totals button looks like the Greek letter Sigma. By clicking this button, Access adds another row to the grid. As a default, the words Group by appear under each field. To reveal many other available functions, drop down the list of choices available for the Total cell. Additional available functions include Sum, Avg, Min, Max, and Count. These functions allow the user to use these fields for grouping, categorizing, and subtotaling.

Grouping and Summing in a Query


1. Move to the Design view if necessary 2. Delete the Donation Date, Donation, In-Kind Value columns 3. Click on the Totals button on the toolbar 4. Drop down the choices for the Total cell under Extended Price 5. Select the Sum function 6. Run the Query and notice the result

TEAMTech Austin

Page 75

Lesson Five: Querying Data

Query Several Tables


The true power of Access is revealed by its ability to allow the user to Query information from multiple Tables. Querying data from several Tables is the end result of the relational database. As an example, to print invoices from a relational database, it would be necessary to pull the customer information from the Customer Table, the order information from the Orders Table, and the product information from the Product Information. The relationships created in Access make the above actions possible. Once inside the Query Design view, it is possible to add more than one Table to the window. The Table relationships are designated with lines drawn from one field to the next. By dragging data fields from the several Tables shown, Access automatically retrieves the requested data.

TEAMTech Austin

Page 76

Lesson Five: Querying Data

Table Names
Under the View menu, there is a Table Names option. This option is used to add a row to the QBE grid. This new row will show which Table the field originated from. This information is important for Querying multiple Tables.

Querying Several Tables


1. Close down the My Donations Query and Save it 2. Create a new Query by clicking on the New button 3. Click on Design View and click on OK 4. Add all three Tables to the Query grid 5. Click on View/Table Names 6. Drag down the fields shown in the picture 7. Add the criteria shown in the picture 8. Run the Query by switching to the datasheet 9. Notice the information from each Table is combined in the Dynaset

Create the Following Queries


1. The list for all donors who gave to the IBM 3rd annual project (386) 2. The list of all customers in CA or NV who gave to the 3rd IBM project 3. The list of Donors who made a single donation greater than $1,000 4. The Donor contacts who gave to the 2nd HP bake after February 1,1992

TEAMTech Austin

Page 77

Lesson Six: Reporting the Data

Lesson Six: Reporting the Data


1. What is a Report? 2. The Report Wizard 3. Customize the Report 4. Preview and Save a Report

TEAMTech Austin

Page 79

Lesson Six: Reporting the Data

What is a Report?
Reports in Access are created for presentation of Tabled or queried data in a professional manner. Programmers in Visual Basic and C++ utilize Access for printing Reports because of its tremendous ease and flexibility. Reports are based on either a Table or a Query. Any field can be dropped into the Report from the available list of fields. The Report is broken down into several sections. The sections are listed and defined below. Report Header Anything in this section is placed at the top of the Report, and it will only show up at the top of the first page. Generally, the name of the Report and the date go in this section. Page Header Text and objects in this section will show up at the top of every page. Most often, the column headings for the data appear in this section.

Group Header If the Report is a Groups / Totals Report, this section will generally contain the heading for a group. As an example, the department name would appear here if a list of employees by department is shown. Detail The detail section is normally the largest section of the Report. Place data fields that will print out the data in each record of the Query or Table here. This area displays at the end of every group. It will generally contain any totals that apply to the entire group. Information in this section will appear at the bottom of every page. Users will often place the page number in this section.

Group Footer

Page Footer

Report Footer Information in this section appears only at the end of the Report. In a Groups / Totals Report, this section could contain the grand totals for information that was sub-totaled at the end of each group.

TEAMTech Austin

Page 80

Lesson Six: Reporting the Data The picture below displays the design view for a grouping Report. Upon first glance at a design for a Report, it can appear somewhat intimidating. The concepts of the Report are actually quite simple, as explained on the previous page.

Observe the Report Design


1. Close down the Query object from the previous exercise if necessary 2. Move to the Report objects in the database window 3. Select the Report named Donations by Month 4. Click the Design button to observe the design 5. Close the Report object window

TEAMTech Austin

Page 81

Lesson Six: Reporting the Data

The Report Wizard


One of the greatest front end advancements from the previous version of Access to the current one is the addition of Wizards, and of the Report Wizards in particular. Accessing the Report Wizard removes the need to start Reports from scratch. With the massive number of Reports created for a database, this is a time saver. After clicking on the New button while viewing the Report objects, Access will ask for the name of the Table or Query from which this Report is to be based. This version of Access offers five types of Report Wizards from which to choose. After clicking on the appropriate Report Wizard button, the wizard will begin.

Types of Report Wizards


The first step in the use of Wizards is to select which one to use. Notice that one of the wizards listed here is Mailing Labels. This means that it is no longer necessary to export the data to Microsoft Word to create mail labels, and that it is now possible to create the mailing labels in Access! The available Report Wizards are listed below. Report Wizard Speeds up the process of creating a Report because it does all of the basic work. The Report Wizard prompts for information and creates a Report based on the answers. Each field appears on a separate line with a label to its left. Does not ask any more questions. The fields in each record appear on one line, and the labels print once at the top of each page. Creates a chart with the Report. Creates a Report formatted for mailing labels.

AutoReport: Columnar

AutoReport: Tabular

Chart Wizard Label Wizard

TEAMTech Austin

Page 82

Lesson Six: Reporting the Data

Create a Grouping Report


1. From the Report objects, click the New button 2. Click the Report Wizard button, and click OK 3. Select the Table Donations from the list of Tables / Queries 4. Select all fields for the Report by clicking on the right double arrow 5. Click the Next button

6. Double-click the Donation Date field 7. Click the Grouping Options button and select Month

TEAMTech Austin

Page 83

Lesson Six: Reporting the Data 8. Click the Next button 9. Click the drop-down arrow and choose the Fundraiser ID field and the Donation field as the fields by which to sort 10. Click the Summary Options button, select the sum for Donation and In-kind Value, click OK, and then click Next 11. Select the Outline 1 layout, and click Next 12. Select the Corporate style, and click Next 13. Type in the title My Donations by Month 14. Select Preview the Report 15. Click the Finish button

TEAMTech Austin

Page 84

Lesson Six: Reporting the Data

Customize the Report


Once a Report is created in Access using a Wizard, the user may find it necessary to make some desired adjustments to the Report prior to printing. The following paragraphs describe the formatting options in the Design view. Delete a Field Delete a field by selecting it with a click and then pressing the delete key on the keyboard. Move fields by clicking and dragging. Resize fields by clicking and dragging the resize handles that appear when a field is selected. Do not make a field so small that it hides the data. Resize the different sections of a Report to allow for more fields by placing the mouse pointer near the bottom of the section. The mouse should take the shape of a two-headed arrow. Resize the section with a click and drag either up or down. Draw color and lines by using Back Color, Fore Color, and Border Color for the Report. These are buttons, and they are located on the toolbar. By first selecting an object and then a color from the palette, format the objects on the Report. Draw lines and boxes by first selecting the object and then clicking on the Border Color button.

Move a Field Resize a Field

Resize a Section

Add Lines / Color

In the Design View of the Report, the Toolbox button on the toolbar opens the Formatting (Form/Report Design) Toolbar for additional formatting options.

TEAMTech Austin

Page 85

Lesson Six: Reporting the Data

Customize a Report
1. Go to Design View of the Report 2. Click the Heading object to select it, and drag it so that it extends over the entire width of the Report 3. Click the Center button on the toolbar 4. Drop down the list of available fonts and select Arial 5. Change the point size of the font to 18 6. Drag the Donation Date Footer to the same height as the header 7. Select both sums by using a Shift + Click 8. Click each sum object in the footer and extend the height 9. Delete the Donation Date from between Donation and In-Kind Value (on the Header and the Detail) 10. Resize the Donation and the In-Kind Value fields from the right (on the Header and the Detail) 11. This action will line up the numbers with the headings 12. The Report should resemble the picture below

TEAMTech Austin

Page 86

Lesson Six: Reporting the Data

Preview and Save a Report


Preview a Report The Print Preview button on the toolbar will Preview the Report. This preview is true WYSIWYG. Access uses actual data from the Query or database and displays an actual preview of the data. Layout Preview is used to get a quick peek at how the Report is going to be laid out. This button should only be used to check the vertical and horizontal alignment of data and labels in the Report. Access does not perform the actual Query, and it does not pull all true data from the Table. The data may be mixed up; for instance, the contact name of one person and the company name of another person may appear together. To use Layout Preview, click the Report View drop-down arrow and choose Layout Preview. Warning: The Layout Preview button is for layout purposes only! The displayed data is only a sample, and it is not true WYSIWYG. Save a Report Once the Report is formatted, save the Report from the Design view by clicking the diskette button on the toolbar. This saves the Report under the name given during the creation of the Report. As with other objects in Access, the Report name length is not limited to eight characters and a three character extension.

Save the Report


1. From the Design View, go to File/Save As 2. Save the Report as My Donations by Month, and click OK 3. Close the Report

TEAMTech Austin

Page 87

Lesson Seven: Importing Data

Lesson Seven: Importing Data


1. Import Data from Microsoft Excel 2. Exit Access

TEAMTech Austin

Page 89

Lesson Seven: Importing Data

Import Data from Microsoft Excel


As an estimate, 90% of all Access users are converting from another Form of database. The most common question is, Can I transfer all of my data into Access without any major headaches? The answer is a resounding, YES! Import from the database window by selecting File/Get External Data and then choosing Import or Link Tables from the menu bar.

Access opens the Import dialog box and asks the user to select the location of the file, the file type, and the file name.

TEAMTech Austin

Page 90

Lesson Seven: Importing Data

Import Data from an Excel File


1. Click File/Get External Data/Import 2. Select Microsoft Excel from the Files of Type list 3. Select A: for the files location 4. Select XLIMPORT.XLS from the diskette, and then IMPORT 5. Select Show Worksheets, and click Next 6. Select First Row Contains Column Headings and click Next 7. Select to place the data in a new table, and click Next 8. Do not specify any new fields; click Next 9. Let Access add a Primary Key, click Next, and then Finish 10. Notice that there is now a new Table object called XLIMPORT

TEAMTech Austin

Page 91

Lesson Seven: Importing Data

Exit Access
To exit out of Access, close and save all databases, and then go to File / Exit or use the ALT + F4 keystroke.

Exit Out of Access


1. Save and close any open database 2. Go to File / Exit on the Menu bar

TEAMTech Austin

Page 92

Glossary

Index
Add Field Lines / Color, 85 AutoCorrect, 43 AutoFormat, 64 AutoReport: Columnar, 82 AutoReport: Tabular, 82 Blank Database, 21 Chart Wizard, 82 Control Menu Icon, 14 Counter, 26 Creating a New Database, 21 Creating a Table, 24 Creating Relationships, 37 Criteria, 68, 71, 72 Criteria Symbols, 71 Crosstab Query, 67, 96 Currency, 26 Customize a Report, 86 Customizing the Report, 85 Data Entry Symbols, 32 Database, 16, 96 Database Terms, 16 Database Window, 15 Database Wizard, 17 Datasheet view, 40 Datasheet View, 25, 32 Date / Time, 26 Delete a Field, 85 Deleting a Relationship. See Table Relationship Design of a Form, 61 Design view, 35 Design View, 25, 61, 64 Design View Pointer Shapes, 62 Detail, 61, 80 Dynaset, 32, 66, 69, 70, 74 Edit Data, 70 Editing a Relationship, 37 Editing Data, 40, 42 Entering Data, 32 Entering Records, 34 Exit, 92 Expression, 42, 71, 72 Field, 16, 26, 27, 32, 41, 47, 49, 68, 71, 85, 102 Field Data Types, 26 Filter by Form, 52 Filter by Selection, 53 Filter Data, 51 Filtering, 51 Find Feature, 46, 47 flat database, 11, 98 Form, 16, 56, 60 Form Wizard, 57, 58, 59 Forms, 64 Glossary, 95 Group Footer, 80 Group Header, 80 Grouping and Totals, 75 Header and Footer, 61 Import Data, 91 Importing Data, 90 Label Wizard, 82 Locate Records, 60 Locating Records, 45 Match Case, 46 Maximize, 14 Memo, 26 Menu Bar, 14 Minimize, 14 Move a Field, 85 Multiple Primary Keys, 28 Navigating With the Mouse, 33 Number, 26 Object, 16, 26, 50, 73, 97, 101 OLE Object, 26 Page Footer, 80 Page Header, 80 Performing Calculations, 74 Primary Key, 28, 39 Print Preview, 87 QBE grid, 42, 68, 72, 74, 75, 77 Query, 16, 54, 66 Query By Example Grid, 68 Query Wizard, 66, 67 Querying Several Tables, 76 Quick Preview, 87

TEAMTech Austin

Page 93

Glossary
Quick Sort, 48 Record, 16, 98 Referential Integrity, 38 relational database, 11, 102 Report, 16, 80, 98 Report Footer, 80 Report Header, 80 Report Sections, 80 Report Wizard, 82 Reporting the Data, 79 Resize a Field, 85 Resize a Field Section, 85 Restore, 14 Save a Report, 87 Saving a Filter, 54 Saving a Report, 87 Saving Records, 33 Saving the Query, 73 Scratch, 31 Scroll Bars, 15 Set a Primary Key, 28 Sort Data, 48, 49 Sorting, 50 Start Access, 13 Status Bar, 15 subform, 56 Table, 16 Table Creation, 24 Table Design, 35, 36 Table Names button, 77 Table Relationships, 37 Table Wizard, 29 tabular form, 56 Text, 26 Title Bar, 14 Toolbars, 15 Toolbox button, 85 Undo, 41 Undo Record, 41 Wildcards, 71 WYSIWYG, 87 Zoom Box, 42

TEAMTech Austin

Page 94

Glossary

Glossary

A
Action The basic building block of a macro. A self-contained instruction that can be combined with other actions to automate tasks. Active A command in a menu, window, or icon that appears inverted or in dark letters. Application A program used for performing a certain type of work, such as word processing, spreadsheets, graphics, projects, presentations, databases, and desktop publishing. This term is used interchangeably with "Program." There are both Windows Applications and Non-Windows Applications. Arrow Keys The keys used to navigate around the screen. They are usually located between the number keypad and the typewriter pad on the keyboard. There is an up, down, left, and right arrow key.

B
Binary A number system that uses only combinations of 0 and 1. These digits can be used to represent off and on or true and false. The binary number system is what all digital computers use. Boolean An expression that can be evaluated as being either true (non-zero) or false (zero). The field data type Yes / No is Boolean; Yes = 1, No = 0.

Burn-in A condition a monitor can get that causes faded images to remain on the screen causing damage to the display. Using a screen saver may prevent this situation. Byte A unit of measure that consists of eight bits. This measurement is equivalent of one character, number, or punctuation mark.

TEAMTech Austin

Page 95

Glossary

C
Cascade A way of arranging open windows on the Program Manager so that they overlap, with only the title bar showing. Chart A graphical representation of data in a Form or a Report. Also called graphs. Check Box A small, square box within a dialog box used to toggle an option on or off. When the check box is selected, an X appears in the box. Close To remove or terminate an application, windows, or dialog box. Use the Control Menu Icon or the File option on the menu bar to close. Condition Part of the criteria that a field must meet for searching or filtering. Control Menu Icon The icon in the upper left corner of every window with a gray minus sign that is used primarily for closing a window. Criteria Criteria are restrictions placed on a query or an advanced filter to identify the specific, desired records. Crosstab Query Displays summarized values (sums, counts, and averages) from one field in a Table and groups them by one set of facts listed down the left side of the datasheet and another set of facts listed across the top of the datasheet. Cursor A marker on the screen that indicates where the next typed characters will appear.

D
Database A database in Access is the sum of all objects in the database window. The entire database is saved as one file with an extension of MDB, which stands for Microsoft Database. Datasheet View The Datasheet view is a window that displays data from a Table or Form in a row and column format. The Datasheet view is where the user edits fields, adds and deletes data, and searches for data. Default The default is the expected response in a dialog box.

TEAMTech Austin

Page 96

Glossary

Design View The Design view is where the Table and Form layout is designed. Desktop This is the background of the computer screen. It is from here that all windows, icons and dialog boxes open. Dialog Box A window that opens after a command is made, in order to request more information and supply other options. Any menu command that has an ellipses (...) will be followed with a dialog box. Document Anything created in an application. A document could be a letter, memo, spreadsheet, or graphic picture. Double-click The action of pressing the mouse button twice in a continuous motion. This motion is used primarily to open or close a window. Dynaset The resulting data of a Query. This Dynaset (dynamic set) of data will constantly change based on changes made to the underlying Table. Any changes that are made to the Dynaset will also change the records in the underlying Table.

E
Embedded Object Anything produced in one document and inserted into another document. Many times embedded objects are taken from one application and placed in a different application. Expression Any combination of operators, constants, literal values, functions, and names of fields, controls, and properties that evaluates to a single value. Use expressions as settings for many properties and action arguments to set criteria or define calculated fields in Queries, and to set conditions macros. Extension The end of a filename that begins with a period followed by three characters. An extension indicates the file type. Many applications apply a default extension to the given filename.

TEAMTech Austin

Page 97

Glossary

F
Field A field is the smallest unit of information in a database. The first name of a customer is an example of a field entry. File A collection of data information that has been created and saved on a disk with a given name. File Format The attributes and structure of a particular file. A file formatted in one application may not be readable in another application due to the differences in the file formats. Flat Database A flat database is one in which all of the information is stored in one file. With a flat database, it is necessary to enter the same information repeatedly throughout the entire database. Floppy Disk A removable disk that can be used to store data. Font Any specific attribute given to a typed character in order to alter its size and design. Footer Text that is placed at the bottom of a document and appears on all following pages. Form A Form is generally used to look at one record at a time on the screen. Forms are used for easy data entry. Format (1) The way a document is arranged in a page or organized in a file. (2) The alteration of a disk to prepare it to store information.

G
Graphical User Interface (GUI) A system that provides the means to communicate with the computer through the use of graphics such as icons, symbols, windows, and menus.

H
Header Text that is placed at the top of a document and appears on all following pages. Help System

TEAMTech Austin

Page 98

Glossary
A series of screens which consist of information about an application or a given topic. Highlight A selected area used to distinguish text, graphics or any other information in order to perform a certain operation such as edit, move, or copy .

I
I-beam The mouse shape which allows the user to work in a text active area. Icon A graphical symbol which represents a function, application or document. Insertion Point The active position in a document or line of text represented by a flashing vertical bar. Input Data entered into the computer in order to be processed. Some input devices are the keyboard, mouse, and scanner.

J
Jump Text Information in a help screen which allows the user to advance to another topic to obtain additional help. Join The connection between linked databases.

K
Keyboard Shortcut The keyboard assignment of a mouse action executed as an alternate and often faster method of performing menu commands. Kilobyte A unit of measure to determine a computers storage and memory capacity. One kilobyte (K) is equivalent to 1,024 bytes.

L
TEAMTech Austin Page 99

Glossary
List Box A part of a dialog box which reveals a list of options and available choices. Local Printer The printer connected directly to one port of the computer.

M
Macro An action or set of actions used to automate tasks. Maximize Button The icon in the upper right corner of a window which enlarges the application or document to its full size. Megabyte A unit of measure which determines a computers storage and memory capacity. One megabyte (MB) is equivalent to 1,048,576 bytes. Menu The area of a window where commands are selected. The menu bar is located under the title bar. Minimize Button The icon in the upper right corner of a window which reduces the application or document to its smallest size, and an icon is created to represent it. Monitor A visual output device containing a video screen similar to a television set. Mouse A hand-controlled, input device which is used to select commands, text, and screen objects. Multitasking Running more than one application at the same time.

N
Network A group of connected computers that use the same software which share equipment and exchange information.

TEAMTech Austin

Page 100

Glossary
Null A value that indicates missing or unknown data in a field. Numeric Keypad A group of numeric keys on the keyboard that includes cursor movement keys. Only when the Num. Lock is on can the keys be used to enter numeric values.

O
Object Tables, Queries, Forms, Reports, Macros, and Modules are all termed objects. Each object stores different types of information used in the database. Object Linking and Embedding An operation involving cutting and pasting in which a link is created from one document or application to another. Operator A symbol or word, such as > and Or, that indicates an operation to be performed on one or more elements. Access has several classes of operators, including arithmetic, comparison, concentration, and logical operators. Option Button A small round button in a dialog box. A dark circle in an option button indicates that the option is selected. In a group, only one option button can be selected.

P
Primary Key The Primary Key is the field whose value or values uniquely identifies each record in a Table. In a relationship, the Primary Key refers to specific records in one Table from another Table. The Primary Key field can not be duplicated in the Table. Pull-Down Menu A list of commands that appear after the main menu is selected.

Q
QBE Grid Query By Example (QBE) grid located in the Design view of Queries. Query A Query is an inquiry into data. A Query allows the user to ask a question of the data.

TEAMTech Austin

Page 101

Glossary
Queue A list of jobs that have been sent to the printer.

R
Record A record is the sum of all fields for one client, person, product, etc. In a Table, one record is one row of the Table. Relational Database The relational database stores information in multiple files. All relational databases are based on the concept of storing information without duplication. In a relational database, it is only necessary to make changes in one place, and then all other areas adjust accordingly. Report A Report is an object that places the data in a presentable format for printing to paper. Restore Button The icon in the upper right corner of a window which reduces a maximized application or document to its original size.

S
Screen Saver A moving picture that appears on the screen when the computer has been out of use for a certain period of time. This prevents burn-in on the computer screen. Scroll Bar A bar that appears on the right or the bottom of a window when there is more information to be viewed. Software A set of instructions, set up as files which tell the computer to perform certain operations. Programs, operating systems and applications are all software. Source Document The document from where linked data originated. Spreadsheet An electronic worksheet that uses formulas to automatically calculate and analyze data. Status Bar A line of information located at the bottom of a window which reveals information about the document, command, or application. Subdirectory A directory which exists under another directory.

TEAMTech Austin

Page 102

Glossary

T
Table The Table is the seed level of all data in the database. All data information is stored in the Table. This is the first type of object created in a new database. Text Box The area in a dialog box where text can be entered or edited. Tile A way to arrange open windows so that they are all visible, and placed side by side. Title Bar The bar located at the top of a window which displays the title of the window or dialog box. Toolbar A horizontal bar located under the menu bar in an application which displays an assortment of icons. Each icon represents a particular function that can be quickly performed in the application. True Type Fonts These are fonts types that will print exactly the way they are shown on the screen, with no alterations, and can be sized to any height.

U
Undo A menu option that allows the user to reverse the most recent function performed.

V
Value the text, date, number, or logical input that completes a condition that a field must meet for searching or filtering.

W
Wallpaper An image displayed behind Program Manager on the desktop.

TEAMTech Austin

Page 103

Glossary
Wildcard Used in filenames to represent a character or group of characters. The question mark (?) is used to represent any single character when it is unknown. The asterisk (*) is used to match a group of characters with others of the same type. For example, *.EXE shows all files with the .EXE extension. Window The area on the screen in which applications, documents, dialog boxes, and groups can be viewed. Windows appear in a rectangular form and all have similar properties. Wizards Help mechanisms that walk the user through creation and modification processes on a step-bystep basis. WYSIWYG An acronym meaning "What You See Is What You Get." This feature in Windows allows the user to see the actual formatting selections on the screen.

Z
Zoom Box Allows the user to edit the contents of a field in a larger window. This makes it easier to read and edit data that surpasses the width of the column.

TEAMTech Austin

Page 104

Você também pode gostar