Microsoft® Office Access™ 2007 All-in-One Desk Reference For Dummies®

 

by Alan Simpson, Margaret Levine Young, Alison Barrows, April Wells, Jim McCarter

 

 

 

About the Authors

Alan Simpson is the author of over 115 computer books on all sorts of topics: Windows, databases, Web-site design and development, programming, and network administration. His books are published throughout the world, in over a dozen languages, and have sold millions of copies. Though definitely in the techno-geek category, we let him contribute anyway because sometimes people like that come in handy.

Margaret Levine Young has co-authored several dozen computer books about the Internet, UNIX, WordPerfect, Access, and (stab from the past) PC-File and Javelin, including The Internet For Dummies (Wiley) and Windows XP Home Edition: The Complete Reference (Osborne/McGraw-Hill). She met her future husband Jordan in the R.E.S.I.S.T.O.R.S., a high-school computer club before there were high-school computer clubs. Her other passions are her children, music, Unitarian Universalism (www.uua.org), reading, and anything to do with cooking or eating.

Alison Barrows has authored or co-authored books on Windows, the Internet, Microsoft Access, WordPerfect, Lotus 1-2-3, and other topics. In addition to writing books, Alison writes and edits technical documentation and training material. In real life she hangs out with her “guys” — Parker, 6, and Mason, 4, and Evan 2 — and tries to carve out some time to practice yoga. Alison lives with her family in central Massachusetts.

April Wells is a graduate of the University of Pittsburgh and holds an MBA from West Texas A&M. She is a database administrator with expertise in a wide variety of enterprise database software programs, including Oracle, DB2, MySQL, and Access. She is the author of several books and white papers on database software and is a frequent public speaker, trainer, and consultant.

 

Dedication

To Susan, Ashley, and Alec, as always. (AS)

To Matt, Parker, Mason, and Evan. (AB)

To the three people who are always there for me, always support me, and never let me down — my family, Larry, Adam, and Amandya. (AW)

 

Authors’ Acknowledgments

We would like to acknowledge the care of Kyle Looper, Chris Morris, and Barry Childs-Helton, and all the others who shepherded this book through the editing and production process, as well as all the folks listed on the Publisher’s Acknowledgements page who worked on this book.

Alison thanks Dotty, Annie, and Matt for taking great care of my little guys so I can get work done. Matt (also known as Honey) gets special thanks as my hardware guru.

 

Publisher’s Acknowledgments

We’re proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/.

Some of the people who helped bring this book to market include the following:

Acquisitions, Editorial, and Media Development

Senior Project Editor: Christopher Morris

Acquisitions Editor: Kyle Looper

Senior Copy Editor: Barry Childs-Helton

Technical Editor: Dan DiNicolo

Editorial Manager: Kevin Kirschner

Media Development Manager: Laura VanWinkle

Editorial Assistant: Amanda Foxworth

Senior Editorial Assistant: Cherie Case

Cartoons: Rich Tennant (www.the5thwave.com)

Composition Services

Project Coordinator: Kristie Rees

Layout and Graphics: Claudia Bell, Carl Byers, Stephanie D. Jumper, Barbara Moore, Barry Offringa, Lynsey Osborn, Heather Ryan, Rashell Smith, Erin Zeltner

Proofreaders: John Greenough, Susan Moritz, Jennifer Stanley

Indexer: Steve Rath

Anniversary Logo Design: Richard Pacifico

Special Help Linda Morris

Publishing and Editorial for Technology Dummies

Richard Swadley, Vice President and Executive Group Publisher

Andy Cummings, Vice President and Publisher

Mary Bednarek, Executive Acquisitions Director

Mary C. Corder, Editorial Director

Publishing for Consumer Dummies

Diane Graves Steele, Vice President and Publisher

Joyce Pepple, Acquisitions Director

Composition Services

Gerry Fahey, Vice President of Production Services

Debbie Stailey, Director of Composition Services

Contents

Title

Introduction

About Access 2007 All-in-One Desk Reference For Dummies

Conventions

Foolish Assumptions

What You Don’t Have to Read

Icons

Organization

Where to Go from Here

Book I : Essential Concepts

Chapter 1: Introducing Access 2007

The Six Types of Access Objects

Essential Database Concepts

Chapter 2: Getting Started, Getting Around

Running Access

Opening a Database

Playing with the Access Sample Databases

The Access Navigation Bar, Ribbon, and File menu

Mission Control: The Navigation Pane

Creating, Deleting, Renaming, Copying, and Printing Objects

Using Wizards

Getting Help

Saving Time with Keyboard Shortcuts

Chapter 3: Creating a Database from Templates

Finding Templates

Exploring a Template

Modifying Objects

Using a Template Database

Chapter 4: Designing Your Database the Relational Way

What Are Tables, Fields, and Keys?

What Are Relationships?

Designing a Database

Tips for Choosing Field Types

Storing Single Facts

Creating a Database

Book II : Tables

Chapter 1: Creating and Modifying Tables

About Table Views

Saving Your Table

Creating Tables for Your Data

Refining Your Table Using Design View

Formatting Fields with Field Properties

Defining the Primary Key

Indexing Fields

Printing Table Designs

Chapter 2: Entering and Editing Data in Datasheets

Looking at a Datasheet

Navigating the Data

Adding and Editing Records

Entering and Editing Hyperlinks

Using the Attachment Data Type

Checking Your Spelling

Using AutoCorrect for Faster Data Entry

Formatting a Datasheet

Taking Advantage of Subdatasheets

Adding a Totals Row to the Datasheet

Chapter 3: Sorting, Finding, and Filtering Data

Sorting the Rows of a Datasheet

Finding (and Replacing) Data

Filtering a Datasheet

Filtering Using Advanced Filter/Sort

Chapter 4: Importing and Exporting Data

Cutting, Copying, and Pasting

Importing or Linking to Data

Getting Data from Another Access Database

Getting Data Out of Access

Collecting Data with Outlook

Chapter 5: Avoiding “Garbage In, Garbage Out”

Finding the Right Tool to Keep Garbage Out

Using Input Masks to Validate and Format Data

Creating a Lookup Field

Validating Data As It’s Entered

Chapter 6: Relating Your Tables and Protecting Your Data

Creating Relationships and Protecting Your Data with Referential Integrity

Referential Integrity with Many-to-Many Relationships

Printing the Relationships Window

Book III : Queries

Chapter 1: Creating Select Queries

Types of Queries

Creating a Query in Design View

Creating a Query with the Simple Query Wizard

Viewing Your Query

Understanding Design View

Tips for Creating a Query

Editing a Query

Limiting Records with Criteria Expressions

Working with Multiple Related Tables

Working with Query Datasheets

Saving Queries

Chapter 2: Letting Queries Do the Math

Doing Math in Queries

Writing Expressions in Access

Using the Expression Builder

Going Beyond Basic Arithmetic

Date and Time Calculations

Manipulating Text with Expressions

Writing Decision-Making Expressions

Testing for Empty Fields

Creating Flexible Parameter Queries

Totals, Subtotals, Averages, and Such

Chapter 3: Doing Neat Things with Action Queries and Query Wizards

Creating Action Queries

Changing Data with Update Queries

Creating New Tables with Make-Table Queries

Moving Data from One Table to Another with Append Queries

Deleting Lots of Records with Delete Queries

Finding Unmatched Records with a Wizard

Finding Duplicate Records

Chapter 4: Viewing Your Data from All Angles Using Crosstabs and PivotTables

Aggregating Data in a Crosstab Query

Analyzing Data with PivotTables

Book IV : Forms

Chapter 1: Designing and Using Forms (and Reports)

Forms and Reports Are Secretly Related

Creating Forms with AutoForms and Wizards

Viewing a Form

Creating Forms (and Reports) in Design View

Configuring the Whole Form or Report

Sizing Forms

Storing Your Forms and Reports

Editing Data Using Forms

Chapter 2: Jazzing Up Your Forms (and Reports)

Taking Control of Your Form or Report

Making Controls That Display Text

Displaying Number, Currency, and Date Fields

Moving, Renaming, Resizing, Deleting, and Copying Controls

Formatting Your Text

Creating Check Boxes for Yes/No Fields

Neatening Up Your Controls

Adding Lines, Boxes, and Backgrounds

Controlling Cursor Movement in Your Form

Chapter 3: Creating Smarter Forms

Creating and Configuring Combo and List Boxes

Cool Looks for Yes/No Fields

Creating Option Groups

Creating Command Buttons

Making a Close Button

Adding and Linking Subforms

Adding Form Headers and Footers

Creating Tabbed Forms

You Can’t Type That Here!

Making Switchboards — A Friendly Face for Your Database

Chapter 4: Doing Calculations in Forms (and Reports)

Doing Elementary Calculations

Calculating and Formatting Numbers

Calculating and Formatting Dates

Calculating and Formatting Text

Displaying Values That Depend on Conditions

Adding Subtotals and Totals from Subforms

Formatting Calculated Controls

Book V : Reports

Chapter 1: Creating and Spiffing Up Reports

If You Know Forms, You Already Know Reports

Creating Reports Automagically

Editing Reports in Design View

Report Sections and How They Work

Formatting Tips and Tricks

Copying Forms to Reports

Adding and Formatting Subreports

Displaying Empty or Long Fields

Displaying Fields That May Be Empty

Creating Mailing Labels

Chapter 2: Printing Beautiful Reports

Viewing Your Report

Formatting the Page

Printing the Report

Sending a Report to Another Application

Chapter 3: Creating Charts and Graphs from Your Data

Displaying Information with Charts and Graphs

Analyzing Your Data Graphically with PivotCharts

Book VI : Macros: Automating Stuff in Access

Chapter 1: Making Macros Do the Work

What Is a Macro?

Creating and Editing Macros

Running Macros

Opening Databases That Contain Macros

Attaching Macros to Forms

Chapter 2: Making Macros Smarter

Only Run This If I Say So

Changing the Way Your Form Looks Dynamically

Displaying Forms and Datasheets

Setting Up Your Own Main Menu Form

Book VII : Database Administration

Chapter 1: Database Housekeeping

Compacting and Repairing Your Database

Making Backups

Converting Databases

Analyzing and Documenting Your Database

Loading and Managing Add-Ins

Locking Up Your Database as an ACCDE File

Chapter 2: Sharing the Fun — and the Database: Managing Multiuser Access

Putting Your Database Where They Can See It

Splitting Your Database into a Front End and a Back End

Putting Your Favorite Objects into Groups

Editing with Multiple Users

Chapter 3: Securing Your Access Database

Windows Security

Setting Startup Options

Password-Protecting Your Database

Granting Database Access to Specific Users

Book VIII : Programming in VBA

Chapter 1: What the Heck Is VBA?

Finding VBA Code

Enabling VBA Code

Using the Visual Basic Editor

Discovering Code as You Go

Chapter 2: Writing Code

How VBA Works

VBA Syntax

Declaring Module Options

Writing Your Own VBA Procedures

Typing and Editing in the Code Window

Testing and Running Your Code

Chapter 3: Writing Smarter Code

Creating Variables and Constants

Making Decisions in VBA Code

Executing the Same Code Repeatedly

Using Custom Functions

Chapter 4: Controlling Forms with VBA

Displaying Custom Messages

Opening Forms with DoCmd

Changing Form Controls with VBA

Understanding Objects and Collections

Chapter 5: Using SQL and Recordsets

Recordsets and Object Models

SQL and Recordsets

Running Action Queries from VBA

Chapter 6: Debugging Your Code

Considering Types of Program Errors

Fixing Compiler Errors

Trapping Runtime Errors

Dealing with Logical Errors

Appendix: Installing Microsoft Access

Activating Access

Repair, Reinstall, or Uninstall Access

: Further Reading