Teach Yourself Visually™ Access® 2010
Table of Contents
An Introduction to Access 2010Start and Exit AccessCreate a Blank DatabaseClose a DatabaseCreate a Database by Using a TemplateOpen a Database FileUnderstanding the Access 2010 InterfaceChange the Navigation Pane ViewOpen and Close an ObjectView an Object
Enter New RecordsNavigate between RecordsEdit RecordsAttach Files to RecordsOpen, Save, and Remove File AttachmentsInsert an OLE ObjectOpen, Edit, and Remove OLE ObjectsEnter Data in a Multivalued FieldDelete RecordsResize Datasheet Columns and RowsSort RecordsDisplay Summary StatisticsPrint a Datasheet or Form
Plan Effective TablesCreate a Table in Datasheet ViewSave a TableCreate a Table in Design ViewOpen a Table in Design ViewRearrange FieldsInsert and Delete FieldsUnderstanding Data TypesChange a Field’s Data TypeUnderstanding Primary and Composite KeysSet the Primary or Composite KeyRename a TableDelete a TableCopy a Table
Understanding Field PropertiesUnderstanding Field SizesChange a Field SizeSet a Field CaptionSet a Field’s FormatSet a Default ValueMake a Field RequiredIndex a FieldApply Smart TagsCreate an Input MaskCreate a Validation RuleCreate a Record-Level Validation Rule
Understanding RelationshipsCreate a Relationship between Two TablesEdit a RelationshipRemove a RelationshipArrange the Relationships WindowPrint a Relationship ReportView Object DependenciesDocument the DatabaseUnderstanding LookupsCreate a Table for Use as a Field LookupCreate a Field Lookup Based on a TableCreate a Field Lookup with Values That You SpecifySet Up a Multivalued Field
Understanding Find and ReplaceFind Data by Using Find and ReplaceReplace Data by Using Find and ReplaceFilter to Show Only Blank or Nonblank EntriesFilter by SelectionFilter for Multiple ValuesUsing Text FiltersFilter by FormSave a Filter As a Query
Understanding QueriesCreate a Query with the Simple Query WizardStart a New Query in Query Design ViewInsert, Arrange, and Remove Query FieldsSet Field SortingAdd an Alias to a Query FieldUnderstanding CriteriaFilter a Query for a Specific ValueSpecify a Range of ValuesSpecify a List of ValuesHide a Field in the Query ResultsCombine CriteriaLimit the Records Returned
Understanding Summary QueriesCreate a Summary Query with the Simple Query WizardCreate a Summary Query in Query Design ViewUnderstanding Calculated FieldsCreate a Calculated FieldUnderstanding Action QueriesRun a Make Table QueryRun a Delete QueryRun an Append QueryRun an Update QueryPrompt the User for a ParameterUnderstanding Parameter Syntax
Understanding FormsCreate and Save a FormCreate a Form with the Form WizardCreate a Form in Layout ViewCreate a Form in Design ViewDelete a Field from Design ViewArrange Fields on a FormGroup Fields TogetherDefine the Tab Order on a Form
Display the Header and FooterResize Sections of a FormSelect Sections of a FormAdd a Form TitleApply a ThemeApply a Font Theme or Color ThemeCreate a Custom Font ThemeCreate a Custom Color ThemeCreate a Custom ThemeBrowse for a Theme to ApplyAdjust Internal Margins and PaddingAdd a LabelFormat Label TextChange the Background ColorUse a Background ImageAdd a HyperlinkAdd a Tabbed SectionInsert a Logo or ImageSet Conditional Formatting
Understanding Report ViewsCreate a Simple ReportApply a Theme to a ReportPreview and Print a ReportCreate a Report with the Report WizardCreate a Report in Layout ViewSet the Page Size and OrientationChange the Report Layout TypeSet Page MarginsSet Control Margins and PaddingFormat Report TextSize and Align Report FieldsInsert a Page-Numbering Code
Understanding Grouping and SummarizingGroup Report ResultsSort Report ResultsCount RecordsAdd an Aggregate FunctionSummarize a Datasheet with a PivotTableAdd and Delete Aggregate Functions in a PivotTableGroup and Ungroup PivotTable ContentClear a PivotTable GridSwitch a PivotTable to a PivotChart
Create LabelsAdd a Field to an Existing LineAdd a Field to a Label as a Separate LineColor the Label BackgroundColor the Label TextApply Font Formatting to Label TextExport Labels to Word
Understanding Charts in AccessOpen a PivotChart ViewStart a PivotChart FormConstruct a PivotChartGroup Data in a PivotChartChange the PivotChart TypeChange Chart ColorsCreate an Embedded Chart Object
Import an Excel WorksheetLink to an Excel WorksheetLink to an Outlook FolderManage Linked TablesImport a Table from Another Access DatabaseImport Data from a Delimited Text FileExport Data to ExcelExport Data as HTMLExport Data to a Plain Text FileSave Import or Export SpecificationsUsing Saved Import or Export Specifications
Begin a Mail MergeCreate the Main Document in WordInsert an Address BlockInsert a Greeting LineMatch FieldsInsert Individual FieldsPreview the Merge ResultsFilter the Recipient ListSort the Recipient ListMerge to a New DocumentMerge Directly to a PrinterSave the Merge for Later Use
Set a Trusted LocationSave in a Previous Version FormatConvert to the Access 2007/2010 FormatBack Up a DatabaseDocument a DatabaseCompact and Repair a DatabasePassword-Protect a DatabaseCreate a SwitchboardSet Switchboard Startup Options
Teach Yourself Visually™ Access® 2010
Teach Yourself VISUALLY™ Access® 2010
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Published simultaneously in Canada
Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, 201-748-6011, fax 201-748-6008, or online at http://www.wiley.com/go/permissions.
Library of Congress Control Number: 2010923552
ISBN: 978-1-118-08185-3
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Trademark Acknowledgments
Wiley, the Wiley Publishing logo, Visual, the Visual logo, Teach Yourself VISUALLY, Read Less - Learn More and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates. Access is a registered trademark of Microsoft Corporation in the United States and/or other countries. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book.
Disclaimer
In order to get this information to you in a timely manner, this book was based on a pre-release version of Microsoft Office 2010. There may be some minor changes between the screenshots in this book and what you see on your desktop. As always, Microsoft has the final word on how programs look and function; if you have any questions or see any discrepancies, consult the online help for further information about the software.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
FOR PURPOSES OF ILLUSTRATING THE CONCEPTS AND TECHNIQUES DESCRIBED IN THIS BOOK, THE AUTHOR HAS CREATED VARIOUS NAMES, COMPANY NAMES, MAILING, E-MAIL AND INTERNET ADDRESSES, PHONE AND FAX NUMBERS AND SIMILAR INFORMATION, ALL OF WHICH ARE FICTITIOUS. ANY RESEMBLANCE OF THESE FICTITIOUS NAMES, ADDRESSES, PHONE AND FAX NUMBERS AND SIMILAR INFORMATION TO ANY ACTUAL PERSON, COMPANY AND/OR ORGANIZATION IS UNINTENTIONAL AND PURELY COINCIDENTAL.
Contact Us
For general information on our other products and services please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993 or fax 317-572-4002.
For technical support please visit www.wiley.com/techsupport.
Sales
Contact Wiley at (877) 762-2974 or fax (317) 572-4002.
Credits
Executive Editor
Jody Lefevere
Project Editor
Christopher Stolle
Technical Editor
Joyce Nielsen
Copy Editor
Marylouise Wiack
Editorial Director
Robyn Siesky
Business Manager
Amy Knies
Senior Marketing Manager
Sandy Smith
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Barry Pruett
Project Coordinator
Lynsey Stanford
Graphics and Production Specialists
Carrie A. Cesavice
Andrea Hornberger
Jennifer Mayberry
Mark Pinto
Quality Control Technician
Jessica Kramer
Proofreading and Indexing
Shannon Ramsey
Johnna VanHoose Dinse
Screen Artist
Jill Proll
Illustrators
Rhonda David-Burroughs
Cheryl Grubbs
About the Author
Faithe Wempen, M.A., is a Microsoft Office Specialist Master Instructor and the author of over 100 books on computer hardware and software, including the PowerPoint 2010 Bible, Microsoft Office 2010 for Seniors for Dummies, and A+ Certification Workbook for Dummies.
Faithe is currently an adjunct instructor of computer information technology at IUPUI, where she teaches PC hardware and software architecture and A+ certification. Her online courses for corporate clients, including Hewlett Packard, Sony, and CNET, have educated over a quarter of a million students all over the world.
Author’s Acknowledgments
Thanks to my wonderful team of editors at Wiley for another job well done, including Jody Lefevere, Christopher Stolle, Marylouise Wiack, and Joyce Nielsen.
How to Use This Book
Who This Book Is For
This book is for the reader who has never used this particular technology or software application. It is also for readers who want to expand their knowledge.
The Conventions in This Book
Steps
This book uses a step-by-step format to guide you easily through each task. Numbered steps are actions you must do; bulleted steps clarify a point, step, or optional feature; and indented steps give you the result of the action.
Notes
Notes give additional information — special conditions that may occur during an operation, a situation that you want to avoid, or a cross-reference to a related area of the book.
Icons and Buttons
Icons and buttons show you exactly what you need to click to perform a step.
Tips
Tips offer additional information, including warnings and shortcuts.
Bold
Bold type shows command names, options, or text or numbers you must type.
Italics
Italic type introduces and defines a new term.
Chapter 1: Getting Started with Access 2010
Are you new to Access or upgrading to the latest version? This chapter explains how to create a database as well as how to navigate through the new-and-improved Microsoft Office Access 2010 interface.
An Introduction to Access 2010
Start and Exit Access 2010
Create a Blank Database
Close a Database
Create a Database by Using a Template
Open a Database File
Understanding the Access 2010 Interface
Change the Navigation Pane View
Open and Close an Object
View an Object
An Introduction to Access 2010
Microsoft Access 2010 is a program for creating databases to store business or personal data. You can use Access to create, retrieve, and manage large or small collections of information.
Relational Databases
Microsoft Access creates relational databases — that is, databases that can contain multiple tables with links between them. For example, a business may have a Customers table for storing customer contact information and an Orders table for storing information about orders placed. Each customer in the Customers table has a unique ID, and each order in the Orders table references a specific customer ID.
Tables, Records, and Fields
In Access, data is stored in tables, and each individual entry in the table is called a record. For example, in a Customers table, the information about each customer is a separate record. Each record is composed of one or more fields that contain individual pieces of data. For example, customer fields may include Name, Address, City, State, and Zip Code.
Datasheets and Forms
By default, each table appears as a spreadsheet grid called a datasheet. You can type directly into a datasheet. To make data entry more convenient, some people choose to create on-screen forms, which are like dialog boxes that prompt for field entries. An attractively formatted form is easier and more pleasant to use to enter new records than a plain datasheet.
Filters and Queries
It is often useful to display a filtered view of a table. You can filter a table to show only certain records, only certain fields, or both. You can run a one-time filter or you can create a query, which is like a saved filter. Queries also enable you to combine data from multiple related tables into a single datasheet of results.
Reports
Tables and query results appear in plain datasheets, which are not very attractive when printed. Reports present data from tables and queries in an attractive, customizable format — complete with titles, headers and footers, and even logos and graphics.
Start and Exit Access
Before you can create or open a database file, you must first start Access. Access starts with the File menu open and the New command selected. From here, you can create a new database or open an existing one. When you are finished working with Access, you should exit the program.
Start and Exit Access
Start Access
Click Start.
Click All Programs.
Click Microsoft Office.
Click Microsoft Access 2010.
The Access program window opens.
Exit Access by Using the Close Button
Click the Close button ().
Access closes, returning you to your desktop view.
Exit Access by Using the File Menu
Click File.
Click Exit.
Access closes, returning you to your desktop view.
Create a Blank Database
A blank database contains only a single blank table and no other database objects, such as queries or forms. It provides the freedom to create exactly the objects that you want for your project.
Create a Blank Database
Click File.
Click New.
Click Blank Database.
Type a file name for the database.
Click Create.
• A new database opens, with a new blank table started.
Close a Database
You can close a database without closing Access 2010 itself. Multiple databases can be open at once, each in its own copy of the application, but closing a database when you are finished with it frees up your computer’s memory.
Close a Database
Click File.
The File menu opens.
Click Close Database.
The File menu stays open, and the New command becomes selected.
Create a Database by Using a Template
You can create a new database based on a template. Templates provide a jumpstart in creating a database by supplying tables, forms, and queries that you are likely to need.
Create a Database by Using a Template
Click File.
Click New.
Click the template category that you want.
• Sample templates are Microsoft-supplied templates stored on your hard disk.
• Office Online Templates are available from the Internet if you are connected.
Click the template that best matches your needs.
Note: Under Sample Templates is a Northwind Traders template, which provides sample data and many objects. This database is used for many of the examples in this book.
• The screen for the template category that you chose appears on the right.
Type a name for the database file or accept the default name.
Click Download.
Note: If you chose a template stored on your local hard drive, the button name in step 6 is Create.
• If you chose an online template, it is downloaded from the Internet.
• A form opens. Its appearance depends on the template that you chose.
Open a Database File
You can open a database that you previously created to continue developing its structure, typing data in it, or analyzing its data. Database files can be stored on a local hard drive or on a network or SharePoint server.
Open a Database File
Browse for and Open a Database File
Click File.
Click Recent.
• If the desired file appears in the Recent Databases list, click it — and you’re done. Otherwise, proceed to the next step.
Click Open.
Note: You can also press + instead of performing steps 1 and 2.
The Open dialog box opens.
• If necessary, you can navigate to a different location.
Click the name of the file that you want to open.
Click Open.
The database file opens.
If a Security Warning Message Bar Appears
• Click Enable Content.
The message bar closes and the content is enabled.
Understanding the Access 2010 Interface
Access 2010 has a user interface consistent with those of other Office 2010 applications, including Word and Excel. It contains tabs, a multiple-tabbed Ribbon, and a status bar.
Understanding the Access 2010 Interface
• File displays a menu of database commands.
• Tabs contain buttons and other controls for working with data.
• The Ribbon displays and organizes tabs.
• Groups organize controls into sections within tabs.
• Clicking this icon opens a dialog box related to the group.
• The Record selector displays the current record number and allows you to navigate to other records.
• Object tabs provide access to all open database objects, such as tables, reports, and forms.
• The Navigation pane lists all available database objects.
• The scroll bars scroll through a datasheet.
• The status bar displays information about the current object or view.
• View buttons switch between various views of the selected object. The buttons are different depending on what type of object is active. Hover over a button to find out which view each button represents.
• The Quick Access Toolbar provides shortcuts to commonly used features. This toolbar is customizable.
Change the Navigation Pane View
The Navigation pane allows you to view and manage database objects, such as tables, queries, reports, and forms. You can display or hide the Navigation pane as well as change the way it sorts and lists objects.
Change the Navigation Pane View
Display the Navigation Pane
If the Navigation pane is hidden, click this button ().
The Navigation pane appears.
Hide the Navigation Pane
If the Navigation pane is displayed, click this button ().
The Navigation pane disappears.
Adjust the Size of the Navigation Pane
Drag the border to the left or right ( changes to ).
• A black line shows the new position for the border.
Change the Way Objects Are Displayed
Click this arrow ().
A menu of object options opens.
Click the way that you want to view the object list.
• You can also filter the list to show only a certain type of object.
• You can choose All Access Objects to return to the full list after filtering.
Open and Close an Object
You can open any available database object from the Navigation pane. The object appears in the main window to the right of the Navigation pane; from there, you can work with its content.
Open and Close an Object
Open an Object
If necessary, click a category to expand it.
Double-click the object.
• To switch among open objects, click the tab of the object that you want.
Close an Object
Right-click on the object’s tab.
A shortcut menu opens.
Choose Close from the shortcut menu.
The object closes.
View an Object
You can display objects in different views. The available views depend on the object type but usually include a view for using the object, such as the Datasheet view, and a view for modifying the object, such as Design view.
View an Object
Select a View from a Menu
Right-click on an open object’s tab.
A shortcut menu opens.
Choose the view that you want from the shortcut menu.
Select a View by Using the View Buttons
Click the button for the view that you want.
Note: The buttons that are available change depending on the object type.
• To determine which view a button represents, you can point to it to see a screen tip.