Microsoft(R) Access(R) 2010 Step By Step

Transcription

Microsoft Access 2010 Step by StepJoyce CoxJoan Lambert

PUBLISHED BYMicrosoft PressA Division of Microsoft CorporationOne Microsoft WayRedmond, Washington 98052-6399Copyright 2010 by Online Training Solutions, Inc.All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by anymeans without the written permission of the publisher.Library of Congress Control Number: 2010928521ISBN: 978-0-7356-2692-8Printed and bound in the United States of America.7 8 9 10 11 12 13 14 15 LSI 8 7 6 5 4 3A CIP catalogue record for this book is available from the British Library.Microsoft Press books are available through booksellers and distributors worldwide. For further infor mation aboutinternational editions, contact your local Microsoft Corporation office or contact Microsoft Press Internationaldirectly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to mspinput@microsoft.com.Microsoft and the trademarks listed at ctualProperty/Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property oftheir respective owners.The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, andevents depicted herein are fictitious. No association with any real company, organization, product, domain name,e-mail address, logo, person, place, or event is intended or should be inferred.This book expresses the author’s views and opinions. The information contained in this book is provided withoutany express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, ordistributors will be held liable for any damages caused or alleged to be caused either directly or indirectly bythis book.Acquisitions Editor: Juliana AldousDevelopmental Editor: Devon MusgraveProject Editor: Joel PanchotEditorial Production: Online Training Solutions, Inc.Cover: GirvinBody Part No. X16-95385[2013-07-19]

ContentsIntroducing Microsoft Access 2010 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ixModifying the Display of the Ribbon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvFeatures and Conventions of This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiUsing the Practice Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiiiYour Companion eBook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxivGetting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvPart 11Simple Database Techniques1Explore an Access 2010 Database3Working in Access 2010 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Sidebar: Enabling Macros and Other Database Content . . . . . . . . . . . . . . . . . . 14Understanding Database Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Exploring Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Sidebar: Tabbed Pages vs. Overlapping Windows . . . . . . . . . . . . . . . . . . . . . . . 22Exploring Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Exploring Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Exploring Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Previewing and Printing Access Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432Create Databases and Simple Tables45Creating Databases from Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Sidebar: Web Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Creating Databases and Tables Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Sidebar: Database Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Manipulating Table Columns and Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Refining Table Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Creating Relationships Between Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75What do you think of this book? We want to hear from you!Microsoft is interested in hearing your feedback so we can continually improve our books and learning resourcesfor you. To participate in a brief online survey, please visit:microsoft.com/learning/booksurveyiii

ivContents3Create Simple Forms77Creating Forms by Using the Form Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Changing the Look of Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85Changing the Arrangement of Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994Display Data101Sorting Information in Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102Sidebar: How Access Sorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106Filtering Information in Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107Filtering Information by Using Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Sidebar: Wildcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115Locating Information That Matches Multiple Criteria . . . . . . . . . . . . . . . . . . . . . . . . 115Sidebar: Saving Filters as Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1195Create Simple Reports121Creating Reports by Using a Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Modifying Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Previewing and Printing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139Part 26Relational Database TechniquesMaintain Data Integrity141143Restricting the Type of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144Restricting the Amount of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149Restricting the Format of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Sidebar: Creating Custom Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158Restricting Data by Using Validation Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159Sidebar: Simple Validation Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

Contents   vRestricting Data to Values in Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167Sidebar: Multicolumn Lookup Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171Restricting Data to Values in Other Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172Sidebar: Multivalued Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1777Create Custom Forms179Modifying Forms Created by Using a Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180Adding Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187Adding Subforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196Sidebar: Different Types of Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204Using E-Mail Forms to Collect Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2078Create Queries209Creating Queries by Using a Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210Creating Queries Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216Using Queries to Summarize Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221Using Queries to Perform Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224Using Queries to Update Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231Using Queries to Delete Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2399Create Custom Reports241Creating Reports Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242Modifying Report Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247Sidebar: Adding Hyperlinks, Charts, and Buttons . . . . . . . . . . . . . . . . . . . . . . . 253Adding Subreports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254Sidebar: Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

viContentsPart 310Database Management and SecurityImport and Export Data263265Importing Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266Importing from Other Access Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267Importing from Excel Worksheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268Importing from Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268Importing from Other Database Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Importing from Outlook Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Importing from SharePoint Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Importing from HTML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271Importing from XML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272Sidebar: Linking to Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281Exporting Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282Exporting to Other Access Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283Exporting to Excel Worksheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283Exporting to Word Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283Exporting to Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284Exporting to PDF and XPS Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284Exporting to SharePoint Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285Exporting to HTML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285Exporting to XML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285Copying to and from Other Office Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29511Make Databases User Friendly297Creating Navigation Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298Creating Custom Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305Controlling Which Features Are Available . . . . . . . . . . . . . . . . . . . .

Microsoft Access 2010 is a powerful relational database program that includes hundreds of tools you can use to quickly start tracking, sharing, and reporting information, even if you are new to database development. Users have access to a large library of profes-sionally designed templates; wizards that automatically create tables, forms, queries, and reports; and extensive local and online .