Tải bản đầy đủ (.pdf) (753 trang)

microsoft office access 2003 - the complete reference (2003)

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.68 MB, 753 trang )

TEAMFLY






















































Team-Fly
®

Microsoft
®
Office
Access 2003:

The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9
Blind Folio i
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9
Blind Folio ii
About the Author
Virginia Andersen became a writer and consultant
after retiring from her defense contracting career.
Since then, she has written over 35 books about
personal-computer-based applications, including
database management, word processing, and
spreadsheet analysis. Virginia spent nearly 15 years
teaching computer science, mathematics and systems
analysis at the graduate and undergraduate levels at
several southern California universities. During her
years as a programmer/systems analyst, Virginia used
computers for many diverse projects, including lunar
mapping for the Apollo astronauts’ landing, reliability
engineering, undersea surveillance, weapon system
simulation, and naval communications. She has also
recently published her memoirs, “Digital Recall:
Computers Aren’t the Only Ones with Memory”
describing many of these hands-on experiences.
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9
Blind Folio ii
P:\010Comp\CompRef8\917-9\fm.vp

Monday, August 11, 2003 1:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Microsoft
®
Office
Access 2003:
The Complete Reference
Virginia Andersen
McGraw-Hill/Osborne
New York Chicago San Francisco
Lisbon London Madrid Mexico City
Milan New Delhi San Juan
Seoul Singapore Sydney Toronto
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9
Blind Folio iii
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
McGraw-Hill/Osborne
2100 Powell Street, 10th Floor
Emeryville, California 94608
U.S.A.
To arrange bulk purchase discounts for sales promotions, premiums, or fund-raisers, please
contact McGraw-Hill/Osborne at the above address. For information on translations or
book distributors outside the U.S.A., please see the International Contact Information page
immediately following the index of this book.
Microsoft
®

Office Access 2003: The Complete Reference
Copyright © 2003 by The McGraw-Hill Companies. All rights reserved. Printed in the
United States of America. Except as permitted under the Copyright Act of 1976, no part of
this publication may be reproduced or distributed in any form or by any means, or stored in
a database or retrieval system, without the prior written permission of publisher, with the
exception that the program listings may be entered, stored, and executed in a computer
system, but they may not be reproduced for publication.
1234567890 DOC DOC 019876543
Book p/n 0-07-222918-7 and CD p/n 0-07-222919-5
parts of
ISBN 0-07-222917-9
Publisher
Brandon A. Nordin
Vice President & Associate Publisher
Scott Rogers
Acquisitions Editor
Megg Morin
Project Editor
Elizabeth Seymour
Acquisitions Coordinators
Tana Allen, Athena Honore
Technical Editor
Margaret Levine Young
Copy Editor
Marcia Baker
Proofreaders
Marian Selig, Susan Carlson Greene
Indexer
Jack Lewis
Composition

Carie Abrew, Tara A. Davis, Lucie Ericksen
Illustrators
Kathleen Fay Edwards,
Melinda Moore Lytle, Lyssa Wald
Series Design
Peter F. Hancik, Lyssa Wald
This book was composed with Corel VENTURA

Publisher.
Information has been obtained by McGraw-Hill/Osborne from sources believed to be reliable. However, because of the
possibility of human or mechanical error by our sources, McGraw-Hill/Osborne, or others, McGraw-Hill/Osborne does not
guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or
the results obtained from the use of such information.
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
Blind Folio FM:iv
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Contents at a Glance
Part I Getting Started
1 Quick Tour of Microsoft Office Access 2003 . . . . . . . . . . . . . . . . . . . . 3
2 The World of Relational Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3 Creating a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4 Creating and Modifying Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5 Relating Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6 Entering and Editing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Part II Retrieving and Presenting Information
7 Sorting, Filtering, and Printing Records . . . . . . . . . . . . . . . . . . . . . . . . 159
8 Extracting Information with Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 179

9 Creating Advanced Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
10 Creating Form and Report Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11 Using the Form Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
12 Customizing Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
13 Using the Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
14 Customizing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
15 Creating Charts and Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
FM:v
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Part III Improving the Workplace
16 Customizing the Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
17 Improving Database Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
18 Understanding Events and the Event Model . . . . . . . . . . . . . . . . . . . . 481
19 Automating with Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
20 Customizing Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
21 Creating Custom Switchboards and Dialog Boxes . . . . . . . . . . . . . . . 553
Part IV Sharing Data with Others
22 Exchanging Database Objects and Text . . . . . . . . . . . . . . . . . . . . . . . . 585
23 Exchanging Data with Outside Sources . . . . . . . . . . . . . . . . . . . . . . . . 609
24 Sharing with Multiple Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
25 Securing a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
A Converting to Access 2003 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
B What’s on the CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
vi
Microsoft Office Access 2003: The Complete Reference

Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Part I Getting Started
1 Quick Tour of Microsoft Office Access 2003 . . . . . . . . . . . . . . . . . . . 3
Starting Access and Opening a Database . . . . . . . . . . . . . . . . . . . . . . . 3
Touring the Access Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Opening a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Touring the Database Window . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Looking at Menu Options and Toolbar Buttons . . . . . . . . . . . 12
Using Shortcut Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Opening a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Touring the Datasheet View . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Looking at a Subdatasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Looking at Data in a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Looking at the Wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Asking a Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Using the Microsoft Access Help Task Pane . . . . . . . . . . . . . . 23
Asking the Office Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Asking What’s This? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Getting Help with What You’re Doing . . . . . . . . . . . . . . . . . . . 26
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
FM:vii

P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:33:24 PM
Color profile: Generic CMYK printer profile
Composite Default screen
2 The World of Relational Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
What Is a Relational Database? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Purpose of Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Types of Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Referential Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Defining Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Inspecting the Sample Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Looking at the Data Distribution . . . . . . . . . . . . . . . . . . . . . . . . 33
Viewing Table Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
The Payoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
A Custom Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
A Custom Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3 Creating a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Designing the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Introducing Home Tech Repair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Determining Goals of the Database . . . . . . . . . . . . . . . . . . . . . . 42
Distributing the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Specifying Key Fields and Relationships . . . . . . . . . . . . . . . . . 46
Completing the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Using the Database Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Previewing the Database Templates . . . . . . . . . . . . . . . . . . . . . 48
Stepping Through the Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Running the New Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Starting with a Blank Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

4 Creating and Modifying Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Creating a New Table Structure with the Table Wizard . . . . . . . . . . . 57
Adding Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Setting the Primary Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Relating to Existing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Creating a New Table from Scratch . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Touring the Table Design View . . . . . . . . . . . . . . . . . . . . . . . . . 63
Adding Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Choosing a Primary Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Creating Other Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Saving the Table Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
viii
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Modifying the Table Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Switching Table Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Adding/Deleting Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Changing the Field Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Changing a Field Name or Type . . . . . . . . . . . . . . . . . . . . . . . . 81
Changing a Field Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Modifying or Deleting the Primary Key . . . . . . . . . . . . . . . . . . 83
Ensuring Data Validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Defining Field Validation Rules . . . . . . . . . . . . . . . . . . . . . . . . . 85
Defining a Record Validation Rule . . . . . . . . . . . . . . . . . . . . . . 87
Requiring an Entry and Preventing Duplicates . . . . . . . . . . . . 88
Handling Blank Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

Assigning a Default Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Copying an Existing Table Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Setting Table Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
How to Change the Default Table Design Properties . . . . . . . 92
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5 Relating Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Defining a Relationship . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Ready-Made Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Using the Relationships Window . . . . . . . . . . . . . . . . . . . . . . . . 96
Viewing and Editing Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Viewing Existing Relationships . . . . . . . . . . . . . . . . . . . . . . . . . 107
Modifying or Deleting a Relationship . . . . . . . . . . . . . . . . . . . . 107
Changing a Table Design from the Relationships Window . . 108
Printing the Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6 Entering and Editing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Entering New Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Copying and Moving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Inserting Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Inserting Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Customizing Data Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Adding Custom Input Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Creating Lookup Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Contents
ix
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen

Changing the Datasheet Appearance . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Displaying Subdatasheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Moving and Resizing Columns and Rows . . . . . . . . . . . . . . . . 137
Freezing and Hiding Columns . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Changing the Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Changing Grid Lines and Cell Appearance . . . . . . . . . . . . . . . 141
Setting Datasheet Default Options . . . . . . . . . . . . . . . . . . . . . . . 143
Changing Table Definition in Datasheet View . . . . . . . . . . . . . . . . . . . 144
Inserting a Subdatasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Inserting/Deleting a Column . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Changing Field Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Editing Record Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Selecting Records and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Locating Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Finding and Replacing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Deleting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Using the Spelling Checker and AutoCorrect . . . . . . . . . . . . . 153
Printing Table Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Part II Retrieving and Presenting Information
7 Sorting, Filtering, and Printing Records . . . . . . . . . . . . . . . . . . . . . . . 159
Sorting Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Sorting on a Single Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Sorting by Two or More Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Saving the Sort Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Filtering Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Filtering By Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Using an Exclusion Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Filtering By Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Optimizing Filter By Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

Filtering For . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Filtering with Advanced Filter/Sort . . . . . . . . . . . . . . . . . . . . . 174
Modifying a Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Saving a Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Removing and Deleting Filters . . . . . . . . . . . . . . . . . . . . . . . . . . 176
x
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
TEAMFLY























































Team-Fly
®

Printing Table Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
8 Extracting Information with Queries . . . . . . . . . . . . . . . . . . . . . . . . . 179
How Do Queries Work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Access Query Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
When to Use a Filter and When to Use a Query . . . . . . . . . . . 180
Creating Select Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Using the Simple Query Wizard . . . . . . . . . . . . . . . . . . . . . . . . 182
Touring the Query Design Window . . . . . . . . . . . . . . . . . . . . . 184
Without the Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Relating Multiple Tables in a Query . . . . . . . . . . . . . . . . . . . . . 189
Adding/Removing Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Running and Saving the Query . . . . . . . . . . . . . . . . . . . . . . . . . 192
Hiding/Showing Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Specifying the Record Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Showing Highest or Lowest Values . . . . . . . . . . . . . . . . . . . . . . 195
Adding Selection Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Using Wildcards and Operators . . . . . . . . . . . . . . . . . . . . . . . . . 197
Using a Single Criterion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Using Multiple Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Getting Help from the Expression Builder . . . . . . . . . . . . . . . . 202

Handling Blank Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Setting Query Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Modifying a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Inserting a Field and Changing the Field Order . . . . . . . . . . . 205
Changing Field Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Performing Calculations in a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Adding a Calculated Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Summarizing with the Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Summarizing with Aggregate Functions . . . . . . . . . . . . . . . . . 210
Creating Special Queries with the Query Wizard . . . . . . . . . . . . . . . . 214
Creating a Find Duplicates Query . . . . . . . . . . . . . . . . . . . . . . . 214
Creating a Find Unmatched Query . . . . . . . . . . . . . . . . . . . . . . 215
Creating a Crosstab Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Printing the Query Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Deleting a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Contents
xi
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
9 Creating Advanced Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Creating Special Purpose Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Parameter Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
AutoLookup Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Designing Action Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Update Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Append Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

Delete Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Make-Table Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Introducing Structured Query Language . . . . . . . . . . . . . . . . . . . . . . . 236
Looking at SQL Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
SQL Conventions and Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Creating a Subquery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Defining a Criterion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Defining a New Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
10 Creating Form and Report Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Deciding Which Database Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Describing the Common Design Elements . . . . . . . . . . . . . . . . . . . . . . 246
Choosing a Record Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Understanding Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Form and Report Design Properties . . . . . . . . . . . . . . . . . . . . . 247
Working in the Design Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Touring the Form Design Window . . . . . . . . . . . . . . . . . . . . . . 249
Starting a New Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Adding Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Modifying Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Selecting Controls and Other Objects . . . . . . . . . . . . . . . . . . . . 261
Moving and Resizing Controls . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Aligning and Spacing Controls . . . . . . . . . . . . . . . . . . . . . . . . . 265
Using Property Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Using the Formatting Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Formatting Conditionally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Changing a Control Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Deleting Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Adding Other Objects and Special Effects . . . . . . . . . . . . . . . . . . . . . . 273
Linking vs. Inserting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

xii
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Adding Bound Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Adding an Unbound Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Adding a Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Changing Form and Report Properties . . . . . . . . . . . . . . . . . . . . . . . . . 277
Changing the Record Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Applying Filters and Sort Orders . . . . . . . . . . . . . . . . . . . . . . . . 278
Resizing a Form or Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Using AutoFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Adding a Background Picture . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Adding a New Object to a Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
11 Using the Form Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Creating a New Form Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Designing the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Starting a New Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Choosing an AutoForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Selecting the Form Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Choosing the Form Layout and Style . . . . . . . . . . . . . . . . . . . . 289
Modifying the Form Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Looking at Some of the Form Properties . . . . . . . . . . . . . . . . . 291
Changing Form Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Moving and Adding Controls . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Sorting and Filtering Data in a Form . . . . . . . . . . . . . . . . . . . . . 297

Using the Form for Data Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Sizing the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Navigating in the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Changing the Tab Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Locating Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Viewing Multiple Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Printing the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Looking at the Other Wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Creating a Hierarchical Form from Related Tables . . . . . . . . . . . . . . . 304
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
12 Customizing Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Starting a New Custom Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Placing and Customizing Data-Related Controls . . . . . . . . . . 307
Contents
xiii
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Adding Yes/No Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Adding User-Interactive Controls . . . . . . . . . . . . . . . . . . . . . . . 315
Creating a Multiple-Page Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Using the Page Break Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Adding a Tab Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Customizing a Tab Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Adding Special Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Adding Calculated Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
ActiveX Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Introducing the Police Department Database . . . . . . . . . . . . . . . . . . . 330

Adding a Subform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
With the Subform Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Without the Subform Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Using the Hierarchical Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Modifying a Subform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Linking and Synchronizing Forms . . . . . . . . . . . . . . . . . . . . . . 337
Adding Custom Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Custom Control Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Status Bar Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Validating or Restricting Data in Forms . . . . . . . . . . . . . . . . . . . . . . . . 341
Validating with Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Validating with Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
13 Using the Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Creating a New Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
What Is the Purpose of the Report? . . . . . . . . . . . . . . . . . . . . . . 345
Selecting, Sorting, and Grouping the Data . . . . . . . . . . . . . . . . 346
Starting a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Choosing an AutoReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Using the Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Previewing the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Working in the Print Preview Window . . . . . . . . . . . . . . . . . . . 359
Using the Layout Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Printing the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Running Page Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Modifying the Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Touring the Report Design Window . . . . . . . . . . . . . . . . . . . . . 364
xiv
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter

P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Examining Report Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Setting Report and Section Properties . . . . . . . . . . . . . . . . . . . . 365
Placing and Adjusting Controls . . . . . . . . . . . . . . . . . . . . . . . . . 366
Changing the Report Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Adding Page Numbers and Date/Times . . . . . . . . . . . . . . . . . 367
Adding Page Breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Saving the Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Using Report Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Creating a Report Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Viewing the Report Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Sending the Report Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
14 Customizing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Creating a New Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Adding Headers and Footers . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Customizing with Special Controls . . . . . . . . . . . . . . . . . . . . . . 378
Basing a Report on a Parameter Query . . . . . . . . . . . . . . . . . . . 381
Sorting and Grouping Records in a Report . . . . . . . . . . . . . . . . . . . . . 384
Changing the Sort Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Adding Group Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Customizing Group Headers and Footers . . . . . . . . . . . . . . . . 387
Adding Summaries and Running Totals . . . . . . . . . . . . . . . . . . 388
Applying the Finishing Touches . . . . . . . . . . . . . . . . . . . . . . . . 390
Modifying and Adding Groups . . . . . . . . . . . . . . . . . . . . . . . . . 390
Adding a Subreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Creating a Subreport Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 395

Inserting an Existing Subreport . . . . . . . . . . . . . . . . . . . . . . . . . 397
Linking the Report and Subreport . . . . . . . . . . . . . . . . . . . . . . . 398
Modifying a Subreport Control . . . . . . . . . . . . . . . . . . . . . . . . . 399
Designing a Multiple-Column Report . . . . . . . . . . . . . . . . . . . . . . . . . 400
Grouping Records in a Multiple-Column Report . . . . . . . . . . 401
Printing Mailing Labels and Envelopes . . . . . . . . . . . . . . . . . . . . . . . . 402
Using the Label Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Manipulating Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Printing Addresses on Envelopes . . . . . . . . . . . . . . . . . . . . . . . 406
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Contents
xv
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:44 PM
Color profile: Generic CMYK printer profile
Composite Default screen
15 Creating Charts and Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Creating a New Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
The Anatomy of a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Selecting the Data for the Chart . . . . . . . . . . . . . . . . . . . . . . . . . 413
Using the Access Chart Wizard . . . . . . . . . . . . . . . . . . . . . . . . . 413
Printing and Saving the Chart . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Linking to Record Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Adding an Existing Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Modifying the Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Modifying with Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Editing with Microsoft Graph . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Part III Improving the Workplace

16 Customizing the Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Personalizing the Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Rearranging Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Creating a Shortcut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Setting Workplace Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Setting Some Command Bar Default Options . . . . . . . . . . . . . 453
Creating Custom Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Changing the Way Access Starts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Modifying the Office Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Showing and Hiding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Setting Office Assistant Options . . . . . . . . . . . . . . . . . . . . . . . . 458
Choosing a Different Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
17 Improving Database Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Optimizing a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Using the Analyzer Wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Optimizing Tables and Queries . . . . . . . . . . . . . . . . . . . . . . . . . 467
Working with Linked Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Optimizing Filter By Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Optimizing Forms and Reports . . . . . . . . . . . . . . . . . . . . . . . . . 469
Optimizing Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Avoiding Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
xvi
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Backing Up and Restoring a Database . . . . . . . . . . . . . . . . . . . . . . . . . 474

Compacting and Repairing a Database . . . . . . . . . . . . . . . . . . . . . . . . . 475
Documenting a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
18 Understanding Events and the Event Model . . . . . . . . . . . . . . . . . . . 481
What Are Events? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Types of Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Understanding the Sequence of Events . . . . . . . . . . . . . . . . . . . . . . . . 487
Form Control Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Form Record Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Form and Subform Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Keystrokes and Mouse Click Events . . . . . . . . . . . . . . . . . . . . . 492
Report and Report Section Events . . . . . . . . . . . . . . . . . . . . . . . 493
Setting Event Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
19 Automating with Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
How Do Macros Work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Creating a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Touring the Macro Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Creating a Simple Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
Choosing Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Setting Action Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Testing and Debugging a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Starting the Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
Stepping Through a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Modifying a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Adding Conditions to a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Running a Macro with a Condition . . . . . . . . . . . . . . . . . . . . . . 506
Choosing Between Two Actions . . . . . . . . . . . . . . . . . . . . . . . . . 506
Assigning a Macro to an Event Property . . . . . . . . . . . . . . . . . . . . . . . 507
Deciding Which Event to Use . . . . . . . . . . . . . . . . . . . . . . . . . . . 508

Some Common Uses for Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Displaying a Message Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Validating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Filtering Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
Setting Values and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Contents
xvii
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Changing the Flow of Operations . . . . . . . . . . . . . . . . . . . . . . . 516
Nesting Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Create a Macro Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Assigning AutoKeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Documenting Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Creating an AutoExec Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
20 Customizing Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Using Access Command Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Showing/Hiding Built-in Toolbars . . . . . . . . . . . . . . . . . . . . . . 527
Showing/Hiding Toolbar Buttons . . . . . . . . . . . . . . . . . . . . . . . 528
Moving/Resizing Command Bars . . . . . . . . . . . . . . . . . . . . . . . 530
Changing Menu and Toolbar Options . . . . . . . . . . . . . . . . . . . . 531
Customizing Command Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Creating a Global Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
Creating Custom Toolbars and Menu Bars . . . . . . . . . . . . . . . . 533
Attaching a Custom Command Bar to an Object . . . . . . . . . . 541
Specifying Global Command Bars . . . . . . . . . . . . . . . . . . . . . . . 542

Deleting a Custom Command Bar . . . . . . . . . . . . . . . . . . . . . . . 543
Modifying Command Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Moving Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Adding and Deleting Controls . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Modifying a Selected Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Restoring Built-in Command Bars . . . . . . . . . . . . . . . . . . . . . . . 551
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
21 Creating Custom Switchboards and Dialog Boxes . . . . . . . . . . . . . . 553
Creating Switchboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Using the Switchboard Manager to Create Switchboards . . . 554
Modifying the Switchboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Creating a Switchboard from Scratch . . . . . . . . . . . . . . . . . . . . 565
Copying the Button Event Procedure . . . . . . . . . . . . . . . . . . . . 567
Creating a Custom Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
Designing the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
Creating and Attaching the Macros . . . . . . . . . . . . . . . . . . . . . . 575
Setting Form Properties and Style . . . . . . . . . . . . . . . . . . . . . . . 576
xviii
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Creating a Dialog Box for User Input . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Setting the Input Form Properties . . . . . . . . . . . . . . . . . . . . . . . 580
Creating the Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Modifying the Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Part IV Sharing Data with Others

22 Exchanging Database Objects and Text . . . . . . . . . . . . . . . . . . . . . . . 585
Copying Objects Among Access Databases . . . . . . . . . . . . . . . . . . . . . 585
Copy-and-Paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Drag-and-Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Importing or Linking Access Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Importing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
Setting Import Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Linking Access Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Importing or Linking to Other Data Sources . . . . . . . . . . . . . . . . . . . . 592
Using Data from dBASE or Paradox . . . . . . . . . . . . . . . . . . . . . 593
Importing and Linking Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Using Delimited Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Using Fixed-Width Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
Changing Import Specifications . . . . . . . . . . . . . . . . . . . . . . . . . 600
Using Linked or Imported Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Renaming a Linked Table in Access . . . . . . . . . . . . . . . . . . . . . 601
Changing Linked Table Properties . . . . . . . . . . . . . . . . . . . . . . 601
Updating Links with the Linked Table Manager . . . . . . . . . . . 602
Unlinking Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Exporting to an Existing Access Database . . . . . . . . . . . . . . . . . . . . . . 604
Exporting to Another Database Format . . . . . . . . . . . . . . . . . . . . . . . . 605
Exporting to Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
23 Exchanging Data with Outside Sources . . . . . . . . . . . . . . . . . . . . . . . 609
Copying or Moving Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Copying or Moving Data from a Word Processor . . . . . . . . . . 609
Copying or Moving Data from a Spreadsheet . . . . . . . . . . . . . 611
Contents
xix
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter

P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Copying or Moving Records from Access to
Another Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
Saving Access Output as an External File . . . . . . . . . . . . . . . . . . . . . . 612
Working with Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Saving in Rich Text Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Saving an Access Table or Query as a Mail Merge
Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Publishing with Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Using Merge It with Microsoft Word . . . . . . . . . . . . . . . . . . . . . 616
Working with Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
Importing from and Linking to Excel Spreadsheets . . . . . . . . 618
Exporting a Table or Query to Excel . . . . . . . . . . . . . . . . . . . . . 622
Using Analyze It with Microsoft Excel . . . . . . . . . . . . . . . . . . . 623
Working with HTML Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
Importing Data from HTML Documents . . . . . . . . . . . . . . . . . 624
Exporting Data to HTML Documents . . . . . . . . . . . . . . . . . . . . 625
Mailing Access Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
24 Sharing with Multiple Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Sharing a Database on a Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Sharing an Entire Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Splitting the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Preventing Exclusive Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
Replicating a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
Database Administration in a Multiuser Environment . . . . . . . . . . . 635
Controlling Data Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636

Minimizing Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Updating Records with Refresh and Requery . . . . . . . . . . . . . 639
Editing Shared Database Objects . . . . . . . . . . . . . . . . . . . . . . . . 640
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
25 Securing a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
Securing a Database with a Password . . . . . . . . . . . . . . . . . . . . . . . . . . 643
Securing a Multiple-User Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
Understanding the User-Level Security Model . . . . . . . . . . . . 645
What Is Needed to Secure a Database? . . . . . . . . . . . . . . . . . . . 647
Securing a Database with the User-Level Security Wizard . . 647
xx
Microsoft Office Access 2003: The Complete Reference
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
TEAMFLY























































Team-Fly
®

Creating a Workgroup Without the Wizard . . . . . . . . . . . . . . . 652
Assigning or Changing Permissions and Ownerships . . . . . . 659
Securing a Replicated Database . . . . . . . . . . . . . . . . . . . . . . . . . 662
Removing User-Level Security . . . . . . . . . . . . . . . . . . . . . . . . . . 662
Other Security Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
Encoding and Decoding a Database . . . . . . . . . . . . . . . . . . . . . 664
Hiding Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
A Converting to Access 2003 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Deciding on a Conversion Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Converting a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
Converting a Workgroup Information File . . . . . . . . . . . . . . . . 669
Converting a Secured Database . . . . . . . . . . . . . . . . . . . . . . . . . 669
Converting a Replicated Database . . . . . . . . . . . . . . . . . . . . . . . 670
Enabling a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
Sharing a Database Across Several Access Versions . . . . . . . . . . . . . . 672

Converting from Access 2002–2003 to Access 97 . . . . . . . . . . . . . . . . . 672
Converting from Access 2002–2003 to Access 2000 . . . . . . . . . . . . . . . 673
B What’s on the CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
Instructions for Using the Access Quick Reference on the CD-ROM 675
Instructions for Using the Access Database Files on the CD-ROM . . . 676
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
Contents
xxi
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9
Blind Folio xxii
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
This page intentionally left blank
Acknowledgments
R
evising this book for the third edition was a pleasure, due especially to working with
the talented and highly professional Osborne editorial and production staff. Megg
Morin, my Acquisitions Editor, is not only an efficient and professional member of
Osborne’s staff—I also consider her a good friend. I would also like to thank Tana Allen and
Athena Honore for their efforts on behalf of this complex book. I appreciate Elizabeth Seymour
for seeing this project through as my project editor. Margaret Levine Young, as the technical
editor, applied her keen eye and clear understanding of the subject matter.
I would also like to express my appreciation to the production staff.

Thanks go, too, to the Coronado Police Department for sharing its Access database with
me and my readers, as well as to my friends and neighbors who posed good-naturedly for
the badge photos you can see in one of the databases. They tell me it’s a good thing I’m a
writer, not a photographer.
I also owe a big debt of gratitude to my literary agent of many years, Matt Wagner of
Waterside Productions, for his continuing support and encouragement.
Finally, my husband, Jack, and all the cats must get a lot of credit for being so patient
with me throughout this long, involved process. The cats don’t really mind because, when
I am working, I have a lap.
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9 / Front Matter
FM:xxiii
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Complete Reference / Microsoft Office Access 2003: TCR / Anderson / 222917-9
Blind Folio xxiv
P:\010Comp\CompRef8\917-9\fm.vp
Monday, August 11, 2003 1:13:45 PM
Color profile: Generic CMYK printer profile
Composite Default screen
This page intentionally left blank

×