Access 2007: The Missing Manual
By Matthew MacDonald
Publisher : O' Re illy
Pub Dat e: D e ce m be r 0 1 , 2 0 0 6
I SBN- 10: 0 - 5 9 6 - 5 2 7 6 0 - 8
I SBN- 13: 9 7 8 - 0 - 5 9 6 - 5 2 7 6 0 - 0
Pages: 6 0 0
Table of Cont ent s | I ndex
Com pared t o indust rial- st rengt h dat abase product s such as Microsoft 's SQL Server, Access is a
breeze t o use. I t runs on PCs rat her t han servers and is ideal for sm all- t o m id- sized businesses and
households. But Access is st ill int im idat ing t o learn. I t doesn't help t hat each new version cram m ed
in yet anot her set of feat ures; so m any, in fact , t hat even t he pros don't know where t o find t hem
all. Access 2007 breaks t his pat t ern wit h som e of t he m ost dram at ic changes users have seen since
Office 95. Most obvious is t he t horoughly redesigned user int erface, wit h it s t abbed t oolbar ( or
" Ribbon" ) t hat m akes feat ures easy t o locat e and use. The feat ures list also includes several longawait ed changes. One t hing t hat hasn't im proved is Microsoft 's docum ent at ion. To learn t he ins and
out s of all t he feat ures in Access 2007, Microsoft m erely offers online help.
Access 2007: The Missing Manual was writ t en from t he ground up for t his redesigned applicat ion.
You will learn how t o design com plet e dat abases, m aint ain t hem , search for valuable nugget s of
inform at ion, and build at t ract ive form s for quick- and- easy dat a ent ry. You'll even delve int o t he
black art of Access program m ing ( including m acros and Visual Basic) , and pick up valuable t ricks
and t echniques t o aut om at e com m on t asks - - even if you've never t ouched a line of code before.
You will also learn all about t he new prebuilt dat abases you can cust om ize t o fit your needs, and
how t he new com plex dat a feat ure will sim plify your life. Wit h plent y of downloadable exam ples, t his
obj ect ive and wit t y book will t urn an Access neophyt e int o a t rue m ast er.
Access 2007: The Missing Manual
By Matthew MacDonald
Publisher : O' Re illy
Pub Dat e: D e ce m be r 0 1 , 2 0 0 6
I SBN- 10: 0 - 5 9 6 - 5 2 7 6 0 - 8
I SBN- 13: 9 7 8 - 0 - 5 9 6 - 5 2 7 6 0 - 0
Pages: 6 0 0
Table of Cont ent s | I ndex
The Missing Credits
Part I: Storing Information in Tables
Chapter 1. Creating Your First Database
Section 1.1. Understanding Access Databases
Section 1.2. Getting Started
Section 1.3. Saving and Opening Access Databases
Section 1.4. The Navigation Pane
Chapter 2. Building Smarter Tables
Section 2.1. Understanding Data Types
Section 2.2. Design View
Section 2.3. Access Data Types
Section 2.4. The Primary Key
Section 2.5. Six Principles of Database Design
Chapter 3. Mastering the Datasheet: Sorting, Searching, Filtering, and More
Section 3.1. Datasheet Customization
Section 3.2. Datasheet Navigation
Section 3.3. Advanced Editing
Section 3.4. Printing the Datasheet
Chapter 4. Blocking Bad Data
Section 4.1. Data Integrity Basics
Section 4.2. Input Masks
Section 4.3. Validation Rules
Section 4.4. Lookups
Chapter 5. Linking Tables with Relationships
Section 5.1. Relationship Basics
Section 5.2. Using a Relationship
Section 5.3. More Exotic Relationships
Section 5.4. Relationship Practice
Part II: Manipulating Data with Queries
Chapter 6. Queries That Select Records
Section 6.1. Query Basics
Section 6.2. Creating Queries
Section 6.3. Queries and Related Tables
Chapter 7. Essential Query Tricks
Section 7.1. Calculated Fields
Section 7.2. Query Functions
Section 7.3. Summarizing Data
Section 7.4. Query Parameters
Chapter 8. Queries That Update Records
Section 8.1. Understanding Action Queries
Section 8.2. Update Queries
Section 8.3. Append Queries
Section 8.4. Delete Queries
Section 8.5. Tutorial: Flagging Out-of-Stock Orders
Chapter 9. Analyzing Data with Crosstab Queries and Pivot Tables
Section 9.1. Understanding Crosstab Queries
Section 9.2. Creating Crosstab Queries
Section 9.3. Pivot Tables
Section 9.4. Pivot Charts
Part III: Printing Reports
Chapter 10. Creating Reports
Section 10.1. Report Basics
Section 10.2. Printing, Previewing, and Exporting a Report
Section 10.3. Formatting a Report
Section 10.4. Filtering and Sorting a Report
Chapter 11. Designing Advanced Reports
Section 11.1. Improving Reports in Design View
Section 11.2. The Report Wizard
Section 11.3. The Label Wizard
Section 11.4. Fine-Tuning Reports with Properties
Section 11.5. Expressions
Section 11.6. Grouping
Part IV: Building a User Interface with Forms
Chapter 12. Creating Simple Forms
Section 12.1. Form Basics
Section 12.2. Sorting and Filtering in a Form
Section 12.3. Creating Better Layouts
Section 12.4. The Form Wizard
Chapter 13. Designing Advanced Forms
Section 13.1. Customizing Forms in Design View
Section 13.2. Taking Control of Controls
Section 13.3. Forms and Linked Tables
Chapter 14. Building a Navigation System
Section 14.1. Mastering the Navigation Pane
Section 14.2. Building Forms with Navigation Smarts
Section 14.3. Linking to Related Data
Part V: Programming Access
Chapter 15. Automating Tasks with Macros
Section 15.1. Macro Essentials
Section 15.2. Macros and Security
Section 15.3. Three Macro Recipes
Section 15.4. Managing Macros
Section 15.5. Connecting Macros to Forms
Section 15.6. Conditional Macros
Chapter 16. Automating Tasks with Visual Basic
Section 16.1. The Visual Basic Editor
Section 16.2. Putting Code in a Form
Section 16.3. Understanding Objects
Section 16.4. Using Objects
Chapter 17. Writing Smarter Code
Section 17.1. Exploring the VB Language
Section 17.2. Dealing with Trouble
Section 17.3. Deeper into Objects
Section 17.4. Using VB to Run a Better Business
Part VI: Sharing Access with the Rest of the World
Chapter 18. Sharing a Database with Multiple Users
Section 18.1. Opening Up Your Database to the World
Section 18.2. Preparing Your Database
Section 18.3. Playing Well with Others
Section 18.4. Data Corruption
Section 18.5. Securing Your Database
Chapter 19. Importing and Exporting Data
Section 19.1. Case for Importing and Exporting
Section 19.2. Using the Clipboard
Section 19.3. Import and Export Operations
Section 19.4. Access and XML
Section 19.5. Collecting Info by Email
Chapter 20. Connecting Access to SQL Server
Section 20.1. Should You Switch to SQL Server?
Section 20.2. Getting Started: SQL Server 2005 Express
Section 20.3. Creating a SQL Server Database
Section 20.4. Adding Objects to a SQL Server Database
Chapter 21. Connecting Access to SharePoint
Section 21.1. Understanding SharePoint
Section 21.2. Setting Up SharePoint
Section 21.3. SharePoint and Access
Part VII: Appendix
Appendix A. Customizing the Quick Access Toolbar
Section A.1. The Quick Access Toolbar
Acce ss 2 0 0 7 : Th e M issin g M a n u a l
by Mat t hew McDonald
Copyright © 2007 O'Reilly Media, I nc. All right s reserved.
Print ed in t he Unit ed St at es of Am erica.
Published by O'Reilly Media, I nc., 1005 Gravenst ein Highway Nort h, Sebast opol, CA 95472.
O'Reilly books m ay be purchased for educat ional, business, or sales prom ot ional use. Online edit ions
are also available for m ost t it les ( safari.oreilly.com ) . For m ore inform at ion, cont act our
corporat e/ inst it ut ional sales depart m ent : ( 800) 998- 9938 or corporat email@example.com .
Pr in t in g H ist or y :
Decem ber 2006:
First Edit ion.
Nut shell Handbook, t he Nut shell Handbook logo, t he O'Reilly logo, and " The book t hat should have
been in t he box" are regist ered t radem arks of O'Reilly Media, I nc. Access 2007: The Missing Manual,
The Missing Manual logo, Pogue Press, and t he Pogue Press logo are t radem arks of O'Reilly Media,
Many of t he designat ions used by m anufact urers and sellers t o dist inguish t heir product s are claim ed
as t radem arks. Where t hose designat ions appear in t his book, and O'Reilly Media, I nc. was aware of
a t radem ark claim , t he designat ions have been print ed in caps or init ial caps.
While every precaut ion has been t aken in t he preparat ion of t his book, t he publisher and aut hor
assum e no responsibilit y for errors or om issions, or for dam ages result ing from t he use of t he
inform at ion cont ained herein.
This book uses RepKover™, a durable and flexible lay- flat binding.
I SBN- 10: 0- 596- 52760- 8
I SBN- 13: 978- 0- 596- 52760- 0
The Missing Credits
About the Author
M a t t h e w M a cD on a ld is an aut hor and program m er ext raordinaire. He's t he aut hor of
Excel 2007: The Missing Manual, Creat ing Web Sit es: The Missing Manual, and over a dozen books
about program m ing wit h t he Microsoft .NET Fram ework. I n a dim ly rem em bered past life, he st udied
English lit erat ure and t heoret ical physics.
About the Creative Team
Pe t e r M e ye r s ( edit or) works as an edit or at O'Reilly Media on t he Missing Manual series. He lives
wit h his wife and cat s in New York Cit y. Em ail: pet er.m eyers@gm ail.com .
Ju e l Bor t olu ssi ( t echnical reviewer) has worked as an Access dat abase developer for invent ory and
asset m anagem ent syst em s in t he design, beverage, and publishing indust ries. She t hinks t his book
would m ake a great classroom t ext book, providing st udent s wit h dat abase, Visual Basic, SQL, and
SharePoint skills. Em ail: j firstname.lastname@example.org
M ich a e l Sch m a lz ( t echnical reviewer) works in banking and perform s business and t echnology
consult ing in a variet y of indust ries. He has done t echnical edit ing for O'Reilly on Microsoft Office
books. Michael has a degree in finance from Penn St at e. He lives wit h his wife and daught er in
Soh a ila Abdu la li ( copy edit or) is a freelance writ er and edit or. She has published a novel, several
children's books, and num erous short st ories and art icles. She recent ly finished an et hnography of an
aboriginal I ndian wom an. She lives in New York Cit y wit h her husband Tom and t heir sm all but
larger- t han- life daught er, Sam ara. She can be reached t hrough her Web sit e at www.sohailaink.com .
Jill St e in be r g ( copy edit or) is a freelance writ er and edit or based in Seat t le, and has produced
cont ent for O'Reilly, I nt el, Microsoft , and t he Universit y of Washingt on. Jill was educat ed at Brandeis
Universit y, William s College, and St anford Universit y. Em ail: saysj ill@m ac.com .
Writ ing a book about a program as sprawling and com plex as Access is a labor of love ( love of pain,
t hat is) . I 'm deeply indebt ed t o a whole host of people, including t hose who helped m e t rack down all
t he neat and nift y t hings you can do wit h t he lat est version of Office ( including bloggers
ext raordinaire Jensen Harris and Erik Rucker) , t hose who kept t he book clear, concise, and
t echnically accurat e ( Pet er Meyers, Sarah Milst ein, Brian Sawyer, Juel Bort olussi, and Michael
Schm alz) , and t hose who put up wit h m e while I wrot e it ( m ore on t hat in a m om ent ) . I also owe
t hanks t o m any people who worked t o get t his book form at t ed, indexed, and print edyou can m eet
m any of t hem on t he Missing Credit s page.
Com plet ing t his book required a few sleepless night s ( and m any sleep- deprived days) . I ext end m y
love and t hanks t o m y daught er Maya, who put up wit h it wit hout crying m ost of t he t im e; m y dear
wife Faria, who m ost ly did t he sam e; and our m om s and dads ( Nora, Razia, Paul, and Ham id) , who
cont ribut ed hours of babysit t ing, t ast y m eals, and general help around t he house t hat kept t his book
on t rack. So t hanks everyonewit hout you half of t he book would st ill be t rapped inside m y brain!
The Missing Manual Series
Missing Manuals are wit t y, superbly writ t en guides t o com put er product s t hat don't com e wit h print ed
m anuals ( which is j ust about all of t hem ) . Each book feat ures a handcraft ed index.
Recent and upcom ing t it les include:
Access 2003 for St art ers: The Missing Manual by Kat e Chase and Scot t Palm er
Access 2007 for St art ers: The Missing Manual by Mat t hew MacDonald
AppleScript : The Missing Manual by Adam Goldst ein
AppleWorks 6: The Missing Manual by Jim Elferdink and David Reynolds
CSS: The Missing Manual by David Sawyer McFarland
Creat ing Web Sit es: The Missing Manual by Mat t hew MacDonald
Digit al Phot ography: The Missing Manual by Chris Grover and Barbara Brundage
Dream weaver 8: The Missing Manual by David Sawyer McFarland
eBay: The Missing Manual by Nancy Conner
Excel 2003 for St art ers: The Missing Manual by Mat t hew MacDonald
Excel 2003: The Missing Manual by Mat t hew MacDonald
Excel 2007 for St art ers: The Missing Manual by Mat t hew MacDonald
Excel 2007: The Missing Manual by Mat t hew MacDonald
FileMaker Pro 8: The Missing Manual by Geoff Coffey and Susan Prosser
Flash 8: The Missing Manual by E. A. Vander Veer
Front 2003: The Missing Manual by Jessica Mant aro
GarageBand 2: The Missing Manual by David Pogue
Google: The Missing Manual, Second Edit ion by Sarah Milst ein, J.D. Biersdorfer, and Mat t hew
Hom e Net working: The Missing Manual by Scot t Lowe
iMovie HD 6: The Missing Manual by David Pogue
iPhot o 6: The Missing Manual by David Pogue
iPod: The Missing Manual, Fift h Edit ion by J.D. Biersdorfer
Mac OS X: The Missing Manual, Tiger Edit ion by David Pogue
Office 2004 for Macint osh: The Missing Manual by Mark H. Walker and Franklin Tessler
PCs: The Missing Manual by Andy Rat hbone
Phot oshop Elem ent s 5: The Missing Manual by Barbara Brundage
PowerPoint 2007 for St art ers: The Missing Manual by E. A. Vander Veer
PowerPoint 2007: The Missing Manual by E. A. Vander Veer
QuickBooks 2006: The Missing Manual by Bonnie Biafore
Quicken for St art ers: The Missing Manual by Bonnie Biafore
Swit ching t o t he Mac: The Missing Manual, Tiger Edit ion by David Pogue and Adam Goldst ein
The I nt ernet : The Missing Manual by David Pogue and J.D. Biersdorfer
Windows 2000 Pro: The Missing Manual by Sharon Crawford
Windows XP for St art ers: The Missing Manual by David Pogue
Windows XP Hom e Edit ion: The Missing Manual, Second Edit ion by David Pogue
Windows XP Pro: The Missing Manual, Second Edit ion by David Pogue, Craig Zacker, and Linda
Windows Vist a: The Missing Manual by David Pogue
Windows Vist a for St art ers: The Missing Manual by David Pogue
Word 2007 for St art ers: The Missing Manual by Chris Grover
Word 2007: The Missing Manual by Chris Grover
I n t he past , people have t ried a variet y of t echniques t o organize inform at ion. They've used
Rolodexes, punch cards, cardboard boxes, vert ical files, Post - it not es, 10,000- page indexes, and
( when all else failed) large piles on t op of flat surfaces. But aft er m uch suffering, people discovered
t hat com put ers were far bet t er at dealing wit h inform at ion, especially when t hat inform at ion's large,
com plex, or changes frequent ly.
That 's where Microsoft Access com es int o t he pict ure. Access is a t ool for m anaging dat abases
carefully st ruct ured cat alogs of inform at ion ( or dat a ) . Dat abases can st ore j ust about any t ype of
inform at ion, including num bers, pages of t ext , and pict ures. Dat abases also range wildly in sizet hey
can handle everyt hing from your list of fam ily phone num bers t o a ginorm ous product cat alog for
Aunt Et hel's Discount But t on Bout ique.
I n t his book, you'll learn how t o design com plet e dat abases, m aint ain t hem , search for valuable
nugget s of inform at ion, and build at t ract ive form s for quick and easy dat a ent ry. You'll even delve
int o t he black art of Access program m ing , where you'll pick up valuable t ricks and t echniques t hat
you can use t o aut om at e com m on t asks, even if you've never t ouched a line of code before.
Best of all, t his book was writ t en from scrat ch for Access 2007, t he lat est and great est incarnat ion of
Microsoft 's best selling dat abase soft ware. Access 2007's quit e a bit different from previous versions,
wit h a slick new int erface t hat has com put er geeks buzzing. And for once, it 's not j ust a gim m ick. As
you'll see in t his book, once you m ast er Access's new st yle, you'll be able t o build great dat abases in
record t im e.
What You Can Do with Access
The m odern world is filled wit h inform at ion. A Web search for a ho- hum t opic like " canned carrot s"
net s m ore t han a m illion Web pages. As a result , it 's no surprise t hat people from all walks of life
need great t ools t o st ore and m anage inform at ion.
I t 's im possible t o describe even a fract ion of t he different dat abases t hat Access fans creat e every
day. But j ust t o get you t hinking like a dat abase m aven, here are som e com m on t ypes of inform at ion
t hat you can st ore handily in an Access dat abase:
Cat alogs of books, CDs, rare wine vint ages, risqué m ovies, or anyt hing else you want t o collect
and keep t rack of
Mailing list s t hat let you keep in t ouch wit h friends, fam ily, and co- workers
Business inform at ion, like cust om er list s, product cat alogs, order records, and invoices
List s of guest s and gift s for weddings and ot her celebrat ions
List s of expenses, invest m ent s, and ot her financial planning det ails
Think of Access as a personal assist ant t hat can help you organize, updat e, and find any t ype of
inform at ion. This help isn't j ust a convenienceit also let s you do t hings you could never accom plish on
I m agine you've j ust finished com piling a dat abase for your collect ion of 10,000 rare com ic books. On
a whim , you decide t o t ake a look at all t he books writ t en in 1987. Or j ust t hose t hat feat ure
Aquam an. Or t hose t hat cont ain t he words " special edit ion" in t he t it le. Perform ing t hese searches
wit h a paper cat alog would t ake days. On an average com put er, Access can perform all t hree
searches in under a second.
Access is also t he king of sm all businesses, because of it s legendary powers of cust om izat ion. Aft er
all, you can use virt ually any dat abase product t o creat e a list of cust om er orders. But only Access
m akes it easy t o build a full user int erface for t hat dat abase ( as shown in Figure I - 1 ) .
The Two Sides of Access
As you'll see, t here are act ually t wo separat e t asks you'll perform wit h Access:
D e sign in g you r da t a ba se . This t ask involves creat ing t ables t o hold dat a, queries t hat can
ferret out im port ant pieces of inform at ion, form s t hat m ake it easy t o ent er inform at ion, and
report s t hat produce at t ract ive print out s.
D e a lin g w it h da t a . This t ask involves adding new inform at ion t o t he dat abase, updat ing
what 's t here, or j ust searching for t he det ails you need. I n order t o do t his work, you use t he
t ables, queries, form s, and report s t hat you've already built .
Figu r e I - 1 .
This sales database includes handy forms that sales people can use to place new orders (shown here), customer
service representatives can use to sign up new customers, and warehouse staff can use to review outgoing shipments. Best of all, the
people who are using the forms in the database don't need to know anything about Access. As long as a database pro (like your future
self, once you've finished this book) has designed these forms, anyone can use them to enter, edit, and review data.
Most of t his book's dedicat ed t o t ask # 1creat ing and perfect ing your dat abase. This j ob's t he heart of
Access, and it 's t he part t hat init ially seem s t he m ost daunt ing. I t 's also what separat es t he Access
m ast ers from t he neophyt es.
Once you've finished t ask # 1, you're ready t o m ove on t o t ask # 2act ually using t he dat abase in your
day- t o- day life. Alt hough t ask # 1 is m ore challenging, you'll ( event ually) spend m ore t im e on t ask
# 2. For exam ple, you m ight spend a couple of hours creat ing a dat abase t o keep t rack of your
favorit e recipes, but you'll wind up ent ering new inform at ion and looking up recipes for years ( say,
every t im e you need t o cook up dinner) .
Access vs. Excel
Access isn't t he only Office product t hat can deal wit h list s and t ables of inform at ion. Microsoft Excel
also includes feat ures for creat ing and m anaging list s. So what 's t he difference?
Alt hough Excel's perfect ly good for sm all, sim ple am ount s of inform at ion, it j ust can't handle t he
sam e quant it y and com plexit y of inform at ion as Access. Excel also falt ers if you need t o m aint ain
m ult iple list s wit h relat ed inform at ion ( for exam ple, if you want t o t rack a list wit h your business
cust om ers, and a list of t he orders t hey've m ade) . Excel forces you t o com plet ely separat e t hese
list s, which m akes it harder t o analyze your dat a and int roduces t he possibilit y of inconsist ent
inform at ion. Access let s you set up st rict links bet ween t ables, which prevent s t hese problem s.
UP TO SPEED
The Benefits of a Good Database
Many people use an address book t o keep t rack of close friends, dist ant relat ives, or annoying coworkers. For t he m ost part , t he low- t ech address book works great . But consider what happens if you
decide t o st ore t he sam e inform at ion in an Access dat abase. Even t hough your cont act list isn't
st oring Google- sized volum es of inform at ion, it st ill offers a few feat ures t hat you wouldn't have
wit hout Access:
Ba ck u p . I f you've ever t ried t o decipher a phone num ber t hrough a coffee st ain, you know
t hat som et im es it helps t o have t hings in elect ronic form . Once you place all your cont act
inform at ion int o a dat abase, you'll be able t o preserve it in case of disast er, and print up as
m any copies as you need ( each wit h som e or all of t he inform at ion showing) . You can even
share your list wit h a friend who needs t he sam e num bers.
Spa ce . Alt hough m ost people can fit all t he cont act s t hey need int o a sm all address book, a
dat abase ensures you'll never fill up t hat " M" sect ion. Not t o m ent ion t hat t here are only so
m any t im es you can cross out and rewrit e t he address for your it inerant Uncle Sy before you
run out of room .
Se a r ch in g . An address book organizes cont act s in one wayby nam e. But what happens once
you've ent ered everyone in alphabet ical order by last nam e, and you need t o look up a cont act
you vaguely rem em ber as Joe? Access can effort lessly handle t his search. I t can also find a
m at ching ent ry by phone num ber, which is great if your phone gives you a log of m issed calls
and you want t o figure out who's been pest ering you.
Sh a r in g . Only one person at a t im e can edit m ost ordinary files, like Microsoft Word docum ent s
and spreadsheet s. This lim it at ion causes a problem if you need your ent ire office t eam t o
collaborat e on a pot - luck m enu. But Access let s m ult iple people review and change your dat a at
t he sam e t im e, on different com put ers. Chapt er 18 has t he full st ory.
I n t e gr a t ion w it h ot h e r a pplica t ion s . Access int roduces you t o a realm of t im esaving
possibilit ies, like m ail m erge. You can feed a list of cont act s int o a form let t er you creat e in
Word, and aut om at ically generat e dozens of individually addressed let t ers. You'll see how t o do
t his in Chapt er 19 .
All t hese exam ples dem onst rat e solid reasons t o go elect ronic wit h alm ost any t ype of inform at ion.
Access also provides all sort s of feat ures t hat don't have any parallel in t he spreadsheet world, such
as t he abilit y t o creat e cust om ized search rout ines, design finet uned form s for dat a ent ry, and print a
variet y of snazzy report s.
Of course, all t his isn't t o say t hat Access is bet t er t han Excel. I n fact , in m any cases you m ight want
Excel t o part ner up wit h Access. Excel shines when crunching ream s of num bers t o creat e graphs,
generat e st at ist ics, or predict t rends. Many organizat ions use Access t o st ore and m anage
inform at ion, and t hen export a port ion of t hat inform at ion t o an Excel spreadsheet whenever t hey
need t o analyze it . You'll learn how t o t ake t his st ep in Chapt er 19 .
Note: Looking to polish up your Excel skills? Check out Excel 2007: The Missing Manual .
Access vs. SQL Server
Microsoft provides anot her dat abase product t he indust rial- st rengt h SQL Server, which powers
everyt hing from Microsoft 's own search engine t o t he NASDAQ st ock exchange. Clearly, SQL Server is
big business, and m any Access fans wonder how t heir favorit e dat abase soft ware com pares.
One of t he m ost im port ant differences bet ween Access and dat abase product s like SQL Server is t hat
Access is a client - side dat abase. I n non- t echie t erm s, t hat m eans t hat Access runs right on your
personal com put er. Dat abase engines like SQL Server are server- based : They st ore t he dat a on a
high- powered server com put er, which you access from a garden variet y PC. ( This int eract ion
happens over a local net work.)
Server- based dat abases are m uch m ore com plex t o set up and m aint ain, but t hey provide enhanced
perform ance and rock- solid st abilit y, even when t housands of people use t hem at once. However, t he
only people t hat require high- end dat abases like SQL Server are large organizat ions. Am azon.com
wouldn't last five m inut es if it had t o rely on an Access dat abase. But Access works j ust fine for m ost
sm all and m id- sized businesses. I t 's also perfect for personal use. ( I f you st ill have lingering doubt s
about whet her Access can m eet your needs, check out t he box " When Access I s Not Enough" in
Sect ion 3.2 .)
Anot her im port ant difference bet ween Access and server- side dat abase product s is t hat Access is an
all- in- one solut ion for st oring and int eract ing wit h dat a. Server- side dat abase engines like SQL Server
focus exclusively on st oring dat a ( and sending t hat dat a t o ot her com put ers when t hey request it ) .
However, t his single- m inded design has a sizable price. An ordinary person can't direct ly edit a
dat abase t hat 's st ored by SQL Server. I nst ead, you need t o use yet anot her program t hat can t alk t o
SQL Server and ask for t he inform at ion it needs. I n m ost cases, t his program needs t o be hand- built
by a savvy program m er. I n ot her words, if you're using SQL Server, you need t o writ e a whole
applicat ion before you can effect ively use your dat abase.
Som et im es, Access fans do t urn int o SQL Server gurus. You can st art wit h a m odest Access dat abase
and t hen st ep up t o SQL Server when your needs exceed what Access provides. The process isn't
always seam less, but it 's possible. You can even keep using Access as a front - end t o m anage your
SQL Server dat abase. You can learn about t his t rick in Chapt er 20 .
The New Face of Access 2007
Ever since Microsoft Office conquered t he world ( way back in t he 1990s) , program s like Word, Excel,
and Access haven't changed a lot . Alt hough a genuinely useful new feat ure appears once in a while,
Microsoft spends m ore t im e wedging in odd gim m icks like a t alking paper clip.
WORD TO THE WISE
When Access Is Not Enough
I f you've picked up t his book, you probably have a good sense t hat Access will m eet your needs. But
if you're in any doubt , a quick realit y check will confirm whet her you're on t he right pat h.
The following list describes a few warning signs t hat suggest you and Access j ust aren't a good fit . I f
you don't fall int o any of t hese cat egories, congrat ulat ionsyou're ready t o use t he m ost
st raight forward and product ive dat abase soft ware anywhere!
You n e e d t o st or e h u ge volu m e s of in for m a t ion ( m or e t h a n 2 giga byt e s of da t a ) .
You're unlikely t o hit t his m ark unless you're st oring large pict ures or ot her t ypes of digit al
cont ent inside a dat abase. Most Access dat abases are several m ega- byt es in size ( about 1,000
t im es sm aller t han t he 2 GB lim it ) .
You 'r e goin g t o sh a r e you r da t a ba se on a n e t - w or k , a n d m or e t h a n a doze n pe ople
n e e d t o u se it a t on ce . I t 's difficult t o correct ly int erpret t his lim it . I t 's perfect ly fine for
hundreds of people t o use your dat abase from t im e t o t im e, but problem s occur when a group
of people are all j ockeying t o m ake changes t o t he sam e dat abase file at t he exact sam e
inst ant . You need t o t est your dat abase t o figure out whet her you can cross t his lim it wit hout
int roducing problem s. Chapt er 18 has m ore inform at ion about sharing Access wit h groups of
You n e e d t o u se you r da t a ba se t o pow e r a W e b a pplica t ion . A Web applicat ion let s lot s
of people access t he dat abase at once. Access probably can't keep up under t he st rain. I n t his
sit uat ion, you're bet t er off wit h a server- side dat abase like SQL Server ( and a crack
program m ing t eam t o help you out ) .
Access 2007 breaks t his pat t ern and int roduces som e of t he m ost dram at ic changes Office fans have
seen since Office 95. The m ost obvious change is t he t horoughly revam ped user int erface ( t he
windows, t oolbars, m enus, and keyboard short cut s you use t o int eract wit h Access) . Aft er spending
far t oo long t rying t o sim plify t he haphazard, t oolbar- choked int erfaces in m ost Office applicat ions,
Microsoft finally worked up t he courage t o redesign it all from scrat ch.
The Access 2007 ribbon is a super- t oolbar t hat replaces t he various t oolbars and m enus in previous
Note: Access doesn't show the ribbon until you create a database. If you can't stand the suspense any longer, and you want to be able
to look at the ribbon on your monitor as you read the next couple of pages, follow the instructions in Section 1.2.1 to create a blank
The ribbon's divided int o t ask- specific t abs Hom e, Creat e, Ext ernal Dat a, and so on. I nit ially, Access
st art s out wit h four t abs ( alt hough ot her t abs appear when you perform specific t asks) . When you
launch Access, you st art at t he Hom e t ab. Click Creat e ( as shown in Figure I - 2 ) , and you get access
t o a slew of powerful com m ands t hat let you add new dat abase com ponent s.
Figu r e I - 2 .
The ribbon's full of craftsman-like detail. When you hover over a button, you don't see a paltry two- or threeword
description in a yellow box. Instead, you see a friendly pop-up box with a complete mini-description. Here, the mouse is hovering over
the Table command.
Tip: Want to reclaim the screen real estate that the ribbon occupies? Just double-click the current tab, and the ribbon collapses, leaving
only the row of tab titles visible. Double-click the tab again to pop the buttons back into sight. Section 1.4.2 has more about this feature.
Here's a quick snapshot of t he four basic ribbon t abs:
H om e gat hers t oget her a variet y of com m on com m ands, including t he fam iliar copy- and- past e
t ools and form at t ing com m ands for t weaking font s and colors. You'll also find handy feat ures
like sort ing, searching, and filt ering, all of which you'll t ackle in Chapt er 3 .
Cr e a t e has com m ands for insert ing all t he different dat abase obj ect s you'll learn about in t his
book ( see Sect ion 1.2 for t he lowdown) . These include t he t ables t hat st ore dat a, t he queries
t hat search it , t he form s t hat help you edit it , and t he report s t hat help you print it .
Ex t e r n a l D a t a has com m ands for im port ing dat a int o Access and export ing it t o ot her
program s. You'll also find feat ures for int egrat ing wit h Microsoft Share- Point Server. You'll use
t hese com m ands in Part Six .
D a t a ba se Tools feat ures t he pro t ools you'll use t o analyze a dat abase, link t ables, and scale
up t o SQL Server. You'll also find t he com m ands for insert ing Visual Basic code, which you'll
explore in det ail in Part Five .
I t 's wort h spending som e t im e get t ing accust om ed t o t he t ab- based ribbon. Try clicking one t ab aft er
t he ot her, rifling back and fort h t hrough t he four sect ions t o see what t hey hold. You'll learn m ore
about all t hese com m ands as you m ake your way t hrough t his book.
Tip: If you have a scroll mouse, you can breeze through the tabs even faster by moving the mouse pointer over the ribbon, and then
moving the scroll wheel up or down.
One nice ribbon t ab feat ure is t hat t hey never changein ot her words, you don't see com m ands
m yst eriously m oving around or winking out of exist ence. Microsoft designed t he ribbon t o be
predict able, so com m ands always rem ain in t he sam e place. However, com m ands will change t heir
arrangem ent a bit if you resize t he Access window, so t hat t hey bet t er use t he available space
( Figure I - 3 ) .
Figu r e I - 3 .
This super-skinny Access window doesn't have much room for ribbon buttons. All the same commands that you
saw in Figure I-2 are still in the ribbon, but now you see only small icons with no text. When you're in doubt about a button, hover over it
to see its name.
Why Reinvent the Wheel?
Som e Access vet erans are underst andably skept ical about t he new Access int erface. Aft er all, we've
had t o suffer t hrough som e painful experim ent s. Past versions of Access have int roduced kooky ideas
like personalized m enus t hat always seem t o hide j ust t he com m and you need, pop- up side panels
t hat appear when you least expect t hem , and float ing t oolbars t hat end up st rewn across t he screen.
I n realit y, all t he Office applicat ions have been st ruggling t o keep up wit h m ore t han a decade's wort h
of new feat ures. The m enus in m ost Office program s haven't changed since Word 2.0 hit t he scene in
t he early 1990s. I n t hose days, a basic m enu and a single t oolbar were j ust t he t icket , because t he
num ber of com m ands was relat ively sm all.
Today, t he Office program s are drowning in feat uresand t hey're cram m ed int o so m any different
nooks and crannies t hat even pros don't know where t o look.
That 's where t he new ribbon fit s in. Not only can you easily underst and and navigat e it , it provides
one- st op shopping for everyt hing you need t o do. Microsoft 's user int erface designers have a new
m ant ra: I t 's all in t he ribbon . I n ot her words, if you need t o find a feat ure, t hen look for it in one of
t he t abs at t he t op of t he Access window. As you get accust om ed t o t his new syst em , you'll find it not
only helps you quickly use your favorit e feat ures, it also helps you discover new feat ures j ust by
Using the Ribbon with the Keyboard
I f you're a diehard keyboard lover, you'll be happy t o hear t hat you can t rigger ribbon com m ands
wit h t he keyboard. The t rick's using keyboard accelerat ors , a series of keyst rokes t hat st art s wit h
t he Alt key ( t he sam e keys you used t o use t o get t o a m enu) . When using a keyboard accelerat or,
you don't hold down all t he keys at t he sam e t im e. ( As you'll soon see, som e of t hem have enough
let t ers t o t ie your fingers up bet t er t han t he rowdiest gam e of Twist er.) I nst ead, you hit t he keys one
aft er t he ot her.
The t rick t o keyboard accelerat ors is t o underst and t hat once you hit t he Alt key, you do t wo t hings,
in t his order:
1 . Pick t h e cor r e ct r ibbon t a b .
2 . I n t h a t t a b, ch oose a com m a n d .
Before you can t rigger a specific com m and, you m ust select t he right t ab ( even if you're already
t here) . Every accelerat or requires at least t wo key presses aft er you hit t he Alt key. You'll need even
m ore if you need t o dig t hrough a subm enu.
By now, t his whole process probably seem s hopelessly im pract ical. Are you really expect ed t o
m em orize dozens of different accelerat or key com binat ions?
Fort unat ely, Access is ready t o help you out wit h a new feat ure called KeyTips . Here's how it works:
Once you press t he Alt key, let t ers m agically appear over every t ab in t he ribbon. Once you hit a key
t o pick a t ab, let t ers appear over every but t on in t hat t ab. You can t hen press t he corresponding key
t o t rigger t he com m and. Figure I - 4 shows how it works.
Figu r e I - 4 .
Top: When you press Alt, Access pins KeyTips next to every tab, over the Office menu, and over the buttons in the
Quick Access toolbar (more about the Office menu and the Quick Access toolbar in a moment).
Bottom: If you follow up with A (for the Database Tools tab), you'll see letters next to every command in that tab. Now you can hit another
key to run a command (for example, W moves your data to SQL Server). Don't bother trying to match letters with tab or button namesthe
ribbon's got so many features packed into it that in many cases, the letters don't mean anything at all.
Note: In some cases, a command may have two letters, and you need to press both keys, one after the other. You can back out of
KeyTips mode at any time without triggering a command by pressing the Alt key again.
Som e ot her short cut keys don't use t he ribbon. These key com binat ions st art wit h t he Ct rl key. For
inst ance, Ct rl+ C copies highlight ed t ext , and Ct rl+ S saves your current work. Usually, you find out
about a short cut key by hovering over a com m and wit h t he m ouse. Hover over t he Past e but t on in
t he ribbon's Hom e t ab, and you see a t oolt ip t hat t ells you it s t im esaving short cut key is Ct rl+ V. And
if you've worked wit h a previous version of Access, you'll find t hat Access 2007 keeps m ost of t he
sam e short cut keys.
Access 2003 Menu Shortcuts
I f you've worked wit h a previous version of Access, you m ay have t rained yourself t o use m enu
short cut skey com binat ions t hat open a m enu and pick out t he com m and you want . When you press
Alt + E in Access 2003, t he Edit m enu pops open ( in t he m ain m enu) . You can t hen press t he S key t o
choose t he Past e Special com m and.
At first glance, it doesn't look like t hese keyboard short cut s am ount t o m uch in Access 2007. Aft er all,
Access 2007 doesn't even have a m ain m enu! Fort unat ely, Microsoft went t o a lit t le ext ra t rouble t o
m ake life easier for longt im e Access aficionados. You can st ill use your m enu short cut s, but t hey work
in a slight ly different way.
I f you hit Alt + E in Access 2007, a t oolt ip appears over t he t op of t he ribbon ( Figure I - 5 ) t hat let s you
know you've st art ed t o ent er an Access 2003 m enu short cut . I f you go on t o press S, t hen you wind
up at t he fam iliar Past e Special dialog box, because Access knows what you're t rying t o do. I t 's
alm ost as t hough Access has an invisible m enu at work behind t he scenes.
Of course, t his feat ure can't help you out all t he t im e. I t doesn't work if you're t rying t o use one of
t he few com m ands t hat don't exist any longer. And if you need t o see t he m enu t o rem em ber what
key t o press next , you're out of luck. Access j ust gives you t he t oolt ip.
Figu r e I - 5 .
By pressing Alt+E, you've triggered the "imaginary" Edit menu. You can't actually see it (because it doesn't exist in
Access 2007). However, the tooltip lets you know that Access is paying attention. You can now complete your action by pressing the
next key for the menu command.
The Office Menu
One sm all part of t he t radit ional Access m enu's left in Access 2007sort of. The t radit ional File m enu
t hat let s you open, save, and print files has been t ransform ed int o t he Office m enu . You get t here
using t he Office but t on, which is t he big, round logo in t he window's t op- left corner ( Figure I - 6 ) .
Figu r e I - 6 .
The Office menu's bigger and easier to read than a traditional menu. When you click it, it displays a list of menu
commands (on the left) and a list of the databases you used recently (on the right).
You generally use t he Office m enu for t hree t hings:
Opening, creat ing, and saving your dat abase. You'll do plent y of t his in Chapt er 1 .
Print ing your work ( Chapt er 3 ) and sending it off t o ot her people by em ail ( Chapt er 19 ) .
Configuring how Access behaves. Choose Access Opt ions at t he bot t om of t he m enu t o get t o
t he Access Opt ions dialog box, an all- in- one hub for configuring Access set t ings.
There's one m enu quirk t hat t akes a bit of get t ing used t o. Som e Office m enu com m ands hide
subm enus t hat have m ore com m ands. Take t he Print com m and. You can choose Print from t he Office
m enu t o fire off a quick print out of your work. But if you click t he right - point ing arrow at t he edge of
t he Print com m and ( or if you hover over it for a m om ent ) , t hen you see a subm enu wit h m ore
opt ions, as shown in Figure I - 7 .
Figu r e I - 7 .
Print's both a clickable menu command and a submenu. To see the submenu, you need to hover over Print (without
clicking), or click the arrow at the right edge (shown here). The ribbon also has a few buttons that work this way.
The Quick Access Toolbar
Keen eyes will have not iced t he t iny bit of screen real est at e t hat sit s on t he Office but t on's right side,
j ust above t he ribbon ( Figure I - 8 ) . This bit of screen holds a series of t iny icons, like t he t oolbars in
older versions of Access. This area's t he Quick Access t oolbar ( or QAT t o Access nerds) .
Figu r e I - 8 .
The Quick Access toolbar puts the Save, Undo, and Redo commands right at your fingertips. Access singles out
these commands because people use them more frequently than any other commands. But as you'll learn in the Appendix, you can add
anything you want here.
I f t he Quick Access t oolbar were not hing but a specialized short cut for t hree com m ands, it wouldn't
be wort h t he bot her. However, t he nift y t hing about t he Quick Access t oolbar is t hat you can
cust om ize it . I n ot her words, you can rem ove com m ands you don't use, and can add your own
favorit es. The Appendix shows how.
Microsoft 's deliberat ely kept t he Quick Access t oolbar very sm all. I t 's designed t o give a carefully
cont rolled out let for t hose cust om izat ion urges. Even if you go wild st ocking t he Quick Access t oolbar
wit h your own com m ands, t he rest of t he ribbon rem ains unchanged. ( And t hat m eans a co- worker
or spouse can st ill use your com put er wit hout suffering a m igraine.)
The New Features in Access 2007
Access 2007's m ost im pressive enhancem ent is t he new int erface. But t he new look isn't t he only
significant change. When Microsoft decided t o rework Access 2007, t hey creat ed a developm ent t eam
t hat was seven t im es larger t han t he t eam t hat creat ed Access 2003. All t his ext ra m anpower allowed
t hem t o m ake a num ber of long- await ed changes. Here are som e of t he highlight s:
A n e w a n d im pr ove d da t a ba se e n gin e . Longt im e Access pros know t hat Access uses t he
Jet engine t o m anage operat ions ( like insert ing and updat ing dat a) behind t he scenes. Jet 's part
of t he Microsoft operat ing syst em , so it 's rarely changed. But Access 2007 now has it s own
cust om ized version of Jet , which let Access creat ors add new feat ures and fine- t une
perform ance. The new dat abase engine goes hand- in- hand wit h a new dat abase file form at , as
you'll see in Sect ion 1.2.2 .
Note: Don't worry, Access 2007 is 100 percent backward compatible with earlier versions. That means you can keep using oldstyle Access 2003 databases in Access 2007, although you can't use a few features (like attachments and complex data,
described next) until you upgrade to the new file format.
At t a ch m e n t s . One of t he nift iest new feat ures in Access is t he At t achm ent dat a t ype, which
let s you st ore ent ire files in your dat abase, including pict ures, docum ent s, and spreadsheet s.
( Movies, m usic, and ot her heft y m edia files need not apply, as all Access dat abases have a 2 GB
dat abase size lim it .) You'll learn how t o use at t achm ent s in Sect ion 2.3.8 .
Ea sy- t o- de sign for m s a n d r e por t s . Creat ing an at t ract ive dat a- ent ry form or print report
used t o t ake a lot of fiddling. I n Access 2007, it 's m uch easier t hanks t o aut om at ic layout a
feat ure t hat groups relat ed pieces of inform at ion t oget her in neat colum ns or t ables. There's
even a new Layout view t hat let s you add form at t ing and see t he result s im m ediat ely.
Com ple x da t a . Com plex dat a's an opt ional new feat ure t hat let s you st ore several values in
one field ( or dat a " slot " ) . Com plex dat a can sim plify your life when you need t o link t ables
t oget her. For exam ple, using com plex dat a, you can associat e several aut hors wit h a single
book. The key reason for int roducing com plex dat a is t o support t he SharePoint int egrat ion
feat ure ( next on t his list ) .
Note: Complex data isn't for everyone. Some database experts may find it an unnecessary and potentially confusing frill. In
Chapter 5 you'll learn how to link tables, and you'll decide whether complex data is a useful shortcut you want to use.
Sh a r e Poin t in t e gr a t ion . SharePoint services are a popular set of feat ures designed t o help
t eam s of people share inform at ion and collaborat e in an organizat ion. These feat ures are built
int o t he Windows Server 2003 operat ing syst em . Using Access 2007, you can m anage and
m odify inform at ion t hat 's st ored in a SharePoint list .
Note: You won't want to use SharePoint if you're content with the tools Access provides. However, you'll love the SharePoint
integration features if you're already using SharePoint to store information or if you need to share data with lots of people, and an
ordinary Access database just can't keep up. You'll learn more about how Access and SharePoint can work together in Chapter
Be t t e r se cu r it y w h e n de a lin g w it h code . As you'll learn in Part Five , dat abase pros use
m acros and handwrit t en program m ing code rout ines t o pull off t ricky t asks. However, Access is
not oriously suspicious of any code, because it has no way t o verify t hat code won't do
som et hing dangerous ( like delet ing your files) . As a result , Access has an aggravat ing habit of
disabling all your code j ust t o be safe. I n Access 2007, you can use t he new t rust cent er t o
specify what dat abases you're ready t o t rust , based on who creat ed t hem or where t hey're
st ored. Access 2007 is also sm art er about recognizing safe code ( code t hat can't possibly cause
dam age) , which it allows even in unt rust ed dat abases.
About This Book
Despit e t he m any im provem ent s in soft ware over t he years, one feat ure hasn't im proved a bit :
Microsoft 's docum ent at ion. I n fact , wit h Office 2007, you get no print ed user guide at all. To learn
about t he t housands of feat ures included in t his soft ware collect ion, Microsoft expect s you t o read t he
Occasionally, t hese help screens are act ually helpful, like when you're looking for a quick descript ion
explaining a m yst erious new funct ion. On t he ot her hand, if you're t rying t o learn how t o, say, creat e
an at t ract ive chart , you'll find not hing bet t er t han t erse and occasionally crypt ic inst ruct ions.
This book is t he m anual t hat should have accom panied Access 2007. I n t hese pages, you'll find st epby- st ep inst ruct ions and t ips for using alm ost every Access feat ure, including t hose you haven't ( yet )
About the Outline
This book is divided int o seven part s, each cont aining several chapt ers.
Pa r t On e : St or in g I n for m a t ion in Ta ble s . I n t his part , you'll build your first dat abase and
learn how t o add and edit t ables t hat st ore inform at ion. Then you'll pick up t he real- world skills
you need t o st op m ist akes before t hey happen, browse around your dat abase, and link t ables
t oget her.
Pa r t Tw o: M a n ipu la t in g D a t a w it h Qu e r ie s . I n t his part , you'll build queries specialized
com m ands t hat can hunt down t he dat a you're int erest ed in, apply changes, and sum m arize
vast am ount s of inform at ion.
Pa r t Th r e e : Pr in t in g Re por t s . This part shows you how t o use report s t o t ake t he raw dat a
in your t ables and form at it int o neat print out s, com plet e wit h fancy form at t ing and subt ot als.
Pa r t Fou r : Bu ildin g a Use r I n t e r fa ce w it h For m s . I n t his part , you'll build form s
cust om ized windows t hat m ake dat a ent ry easy, even for Access newbies.
Pa r t Five : Pr ogr a m m in g Acce ss . Now t hat you've m ast ered t he essent ials of dat abases,
you're ready t o delve int o t he black art of Access program m ing. I n t his part , you'll use m acros
and Visual Basic program m ing t o aut om at e com plex t asks and solve com m on challenges.
Pa r t Six : Sh a r in g Acce ss w it h t h e Re st of t h e W or ld . I n t his part , you'll learn how t o pull
your dat a out of ( or put your dat a int o) ot her t ypes of files, like t ext docum ent s and Excel
spreadsheet s. You'll also see how t o use Access t o int eract wit h som e of Microsoft 's m ost
powerful server soft ware: t he dat abase engine SQL Server and t he collaborat ion soft ware
Pa r t Se ve n : Appe n dix . This book wraps up wit h an appendix t hat shows how t o cust om ize
t he Quick Access t oolbar t o get easy access t o your favorit e com m ands.
Throughout t his book, you'll find sent ences like t his one: " Choose Creat e
m et hod's a short hand way of t elling you how t o find a feat ure in t he Access ribbon. I t t ranslat es t o
t he following inst ruct ions: " On t he ribbon, click t he Cr e a t e t ab. On t he t ab, look for t he Ta ble s
sect ion. I n t he Tables box, click t he Ta ble but t on." ( Look back t o Figure I - 2 t o see t he but t on you're
As you saw back in Figure I - 3 , t he ribbon adapt s it self t o different screen sizes. Depending on your