Unofficial Guide® the to Access™ 2007 Jim Keogh Microsoft® Office 01 045978 ffirs qxp 2/28/07 11 08 PM Page i 01 045978 ffirs qxp 2/28/07 11 08 PM Page iii Unofficial Guide® the to Access™ 2007 Jim Ke[.]
Trang 4The Unofficial Guide® to Microsoft® Office Access™ 2007
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
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, or on the web at www.copyright.com Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN
46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions 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 render- ing 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 here from 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.
Wiley, the Wiley Publishing logo, Unofficial Guide and all related trademarks, logos, and trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc and/or its affiliates, in the United States and other countries, and may not be used without written permission Microsoft and Access are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other coun- tries 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.
For general information on our other products and services or to obtain technical support please tact our Customer Care Department within the U.S at (800) 762-2974, outside the U.S at (317) 572-3993 or fax (317) 572-4002.
con-Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available in electronic books For more information about Wiley products, please visit our web site at www.wiley.com.
Library of Congress Control Number: 2006939465
Trang 5This book is dedicated to Anne, Sandy, Joanne, and Amber-Leigh Christine, without
whose help and support this book couldn’t have been written.
Trang 6Iespecially want to acknowledge the fine contributions of Beth Taylor,Jody Lefevere, and Ken Davidson to this book Their efforts aremuch appreciated
Trang 7Quality Control Technicians
Cynthia FieldsJohn GreenoughCharles Spencer
Trang 8About the Author
Jim Keogh is on the faculty of New York University and Saint Peter’sCollege in Jersey City, New Jersey where he teaches Microsoft Access andother computer courses He was a member of the faculty at ColumbiaUniversity where he developed the e-commerce tract Keogh has spentdecades developing applications for major Wall Street corporations and
is the author of more than 70 books including Java Database Programming
for Dummies, Unix Programming For Dummies, and Linux Programming For Dummies.
Trang 9Acknowledgements vi
Introduction xxvii
I Getting Started 1
1 Getting In and Out 3
Starting Access 2007 3
Start from the desktop 4
Start from the Quick Launch toolbar 4
The Access 2007 environment 5
The Ribbon 5
Galleries 6
Quick Access toolbar 6
Customizing the Quick Access toolbar 7
The Office Button 8
Getting Started with Access 9
Using templates 10
Template Categories 11
From Microsoft Office Online 11
Building a database from a template 11
Building a database from scratch 14
Opening the Northwind 2007 database 16
Working with form views 16
Form view 18
Design view 19
Layout view 20
Working with data views 22
Datasheet view 23
Design view 23
PivotTable view and PivotChart view 24
Working with report views 25
Report view 26
Layout view and Design view 26
Print view 27
Navigating the Ribbon 27
Just the facts 29
vii
Trang 102 All About Data 31
Going over basic concepts 31
A database 32
A database management system 32
A database application 32
Differentiating between information and data 33
From information to data 33
From data to information 34
Organizing data 34
Name fields 35
Name tables 35
A closer look at a field 36
Data type 37
Data size 37
The primary key 38
Data entry 38
Garbage in, garbage out 39
Datasheets 39
Data entry form 40
Data validation 40
Querying the database 41
Writing a query 42
Return data 42
Query expressions 43
Multiple tables 43
Data display 44
What’s a form? 44
What’s a report? 44
Calculating data 45
Sharing data 45
Sharing over a local network 45
Sharing over the Internet 46
Local network versus the Internet 46
Exchanging information 47
Data security 47
Unauthorized access 48
Data backup 48
Corrupt data 49
Data compacting 49
Understanding indexes 49
Picking the key 50
Duplicate values 50
Locating the index 51
Knowing when to create an index 51
Too many indexes 51
Just the facts 52
Trang 11II Data Design and the Database 53
3 Designing a Database 55
Identifying entities 56
Entities and procedures 57
Take samples 57
Deconstructing an entity .58
Make a list 58
Find duplicates 58
Group information 60
Decomposing information into data 61
Information and data, same thing 61
Calculated data 62
Transforming information into a table 62
Describing data 63
Data types 63
Text data type 64
Memo data type 64
Number data type 65
Date/Time data type 65
Currency data type 65
AutoNumber data type 65
Yes/No data type 66
OLE Object data type 66
Attachment data type 66
Hyperlink data type 66
Mask and format .66
Validation rules 67
Caption 67
Default value 67
Decimal places 67
Text alignment 68
Smart Tags 68
Required and Allow Zero Length 68
Lookup wizard 68
Identifying a primary key 69
Single field 69
Compound primary key 69
Auto-generated primary key 70
Relating tables 70
Foreign keys 71
How linking works 71
Creating relationships 71
Identifying Instances 72
One-to-many relationship 72
Many-to-many relationship 73
One-to-one relationship 74
Trang 12Normalizing the database design 74
First normal form 74
Second normal form 75
Third normal form 75
Designing forms and reports 76
What queries do you need? 77
What’s next? 77
Just the facts 78
4 Working with Tables 79
Creating a blank database 79
Creating a table 80
Creating a table in the Datasheet view 81
The Datasheet view layout 81
Setting the data type by entering data 82
Setting the data type manually 82
Changing the field name 83
Setting the format for the field 84
Unique and required fields 85
Deleting and inserting fields 86
Using the New Field tool 87
Adding fields from another table 87
Creating a lookup column 89
Create a lookup column from a table 89
Maintain the relationship 92
Create a lookup column from a list created by hand 93
Modify the table design 94
Rename tables 94
Creating a table in the Design view 94
Exploring Design view 95
Enter a New field 95
Add a field description 95
Setting the primary key 96
Setting field properties 97
Using the Expression Builder .97
Exploring the Expression Builder 98
Common Expressions 99
Using the Input Mask wizard 100
Using Smart Tags 101
Creating a lookup list 102
Creating relationships 103
Just the facts 104
Trang 135 Entering and Editing Data 107
Forms and datasheets 107
Advantages of using a form 108
Tabbing through the form 110
Picking dates 112
Advantages of using a datasheet 113
Hide and display columns 113
Freeze and unfreeze a field 115
Moving fields 116
Using grid lines and changing colors 116
The Home tab 118
Cut, copy, and paste 118
Dress up the datasheet 120
Special treatment for Rich Text fields 121
The Records tool group 122
Totals 122
Check spelling 123
The Refresh tool 124
Cascading updates 124
Finding records 126
Searching 126
Wildcard characters 128
Find blank values 129
Replace values automatically 129
Handy shortcuts for data entry 130
Just the facts 132
6 Filtering and Sorting 133
Examining filters 133
The Selection tool 134
Ready-to-use filters .134
Common filters 135
Text ready-to-use filters 137
Number ready-to-use filters 138
Date/Time ready-to-use filters 139
Using Filter By Form 141
Modifying the filter criteria 143
Using the Or tab 143
Modifying the Or tab 144
Reusable Filter By Form forms 144
Advanced Filter/Sort 147
Using the Expression Builder 149
Using the Filter Tool 151
Trang 14Sorting records 153
Sorting multiple fields 153
Watch out for strange sorts 154
Just the facts 155
7 Importing and Exporting Data 157
Examining importing and exporting data 157
Save time 158
Enhance existing database applications quickly 158
Avoid the pitfalls of importing/exporting 159
Importing and exporting essentials 159
Preparing the database 160
Importing/exporting records 160
Importing/exporting tables 161
Importing/exporting forms and reports 161
Importing/exporting queries 161
Importing/exporting data using Copy and Paste 162
Importing from Excel 162
Exporting to Excel 164
Importing from Word 165
Exporting to Word 166
Copying and pasting into another table 166
Exploring the Import and Export wizards 166
Using the Import wizard 168
Creating an import shortcut 170
Running an import shortcut 171
Using importing options .171
Importing from Excel into a new table 173
Importing from Excel into an existing table 175
Importing a text file 176
Delimited versus fixed width 176
Creating a delimited text file 177
Importing a delimited text file 177
Importing a fixed width text file 179
Importing from a XML file 181
Importing from a SharePoint list 182
Importing from an HTML document .183
Importing from an Outlook folder 184
Importing from an ODBC database .184
Import dBase, Paradox, Lotus 1-2-3 185
Using the Export wizard 185
Exporting to Excel 186
Exporting to a text file 186
Exporting to a PDF or XPS file 187
Exporting to a SharePoint list 187
Exporting to an XML document 188
Trang 15Exporting to an HTML document 189
Exporting to dBase, Paradox, Lotus 1-2-3 189
Exporting to an ODBC database 189
Merge with Word .190
Just the facts 191
III Creating Queries 193
8 Creating a Query 195
Asking a query 195
Ad hoc query 196
Saved queries 196
Complex queries 197
Types of queries 197
Running a query 197
Getting results 198
Querying a query 198
Mastering the Query Wizard 198
Creating a query using multiple tables .200
Using summary options 202
Fine-tuning the Query wizard query 203
Creating a query from the results another query 206
Find Duplicates query 207
Find Unmatched query 208
Mastering the Query Design tool 209
Getting started 209
Selecting tables and queries 210
Relationships 210
Missing lines 211
Selecting fields 212
Displaying fields 212
Sorting results 213
Setting the query criteria 214
Equals 214
Or 214
And 216
Mixing it up with Or 216
Multiple Or values 217
Not 217
In 217
Between 218
Like 218
Using the Query Setup 219
Creating a Parameter query .220
Creating query parameters 220
Using query parameters 221
Trang 16Creating a Union query 222
Creating a Pass-Through query 223
Creating a Data Definition query 225
Query properties .225
Joining tables 227
Equi-join 227
Outer joins 227
Cartesian join 228
Create a query join 228
Delete a query join 228
Just the facts 229
9 Creating Calculation Queries 231
Creating a calculated field in a query 231
Specifying tables and fields 231
Zooming into a cell on the query grid 232
Creating a Total query 233
Finding out about built-in functions 233
Using built-in functions 233
Setting criteria for a built-in function 234
Using GroupBy 235
Concatenate text 235
Using the inline If statement 236
Using the Expression Builder 237
Operator precedence 240
Just the facts 241
10 Creating Action Queries 243
Finding out about action queries 243
Using action queries 244
Getting ready to use action queries 245
Turning off disable mode 245
Creating an Append query 246
Creating an Update query 248
Creating a Delete query 250
Creating a Make Table query 252
Just the facts 253
11 Working with Crosstabs and PivotTables 255
All about Crosstabs 255
Using the Crosstab wizard .256
Working around limitations of the Crosstab wizard 259
Creating a crosstab using the Query Design tool 260
Creating a PivotTable 261
Trang 17Creating a PivotChart 263
Changing the type of PivotChart 264
Insert titles 265
Add a legend 266
Changing the calculation 267
Insert values to the chart 267
Just the facts 267
IV Using Forms 269
12 Designing and Using Forms 271
Figuring out forms 271
Differentiating between a form and a datasheet 272
Types of forms 272
Ways to create a form 273
Sections of a form 274
Controls for forms 275
Creating controls from fields 275
Calculating controls 276
Modifying properties 276
Data sources for a control 276
Using the Form wizard 276
Using built-in forms 279
Modifying a built-in form 280
Changing the appearance of text 280
Changing the text conditionally 280
Formatting numbers 282
Formatting the grid 282
Adding bound controls 282
Changing the logo 283
Changing the title of the form 283
Inserting date and time 283
Changing lines on the form 283
Using AutoFormat 285
Deleting a control 285
Repositioning a control 285
Creating a modal dialog 285
Using the grid and dots 286
Placing and removing controls on the modal dialog 287
Changing the color of the modal dialog 288
Using the Form Designer 288
Resizing the form 288
Adjust your screen resolution 289
Selecting a resource source for a form 289
Creating the form 290
Using the form property 290
Inserting headers and footers 291
Trang 18Using a form 292
Printing a form 293
Converting a form to a report 293
Just the facts .294
13 Using Controls on a Form 295
Choosing the right control .295
Available controls 296
Making tough decisions 297
Using Windows standards 298
Conforming to the Windows look 299
Placing a control onto a form 299
Working with a Label control and input control 299
Changing characteristics of a control 300
Sizing a control 300
Aligning controls 302
Copying and deleting a control 303
Naming controls .303
Setting the tab order 306
Using the Label control 307
Using the Text Box control 309
Using calculations 309
Working with Memo fields 310
Creating an input mask 310
Using the Tab control 311
Inserting a new tab in the Tab control 312
Changing the label on the tab 313
Using Line and Rectangle controls 313
Using Image control 314
Using OLE object controls 314
Just the facts 317
14 Creating Intelligent Forms 319
Looking at intelligent controls 319
Reacting to an event 321
Enabled versus disabled 322
Hide versus visible 322
Selecting events 323
Providing instructions for common events 324
Enabling a control 324
Making a control visible 327
Using the Control wizards 327
Trang 19Using toggle button, option button, and check box controls 328
Using toggle button controls 328
Using option button and check box controls 330
Creating an Option Group 330
Using combo box and list box controls 332
Type values displayed in a combo box or list box 333
Use table/query for values displayed by a combo box or list box 333
Using command button control 334
Using a subform/subreport control 335
Using an existing form as a subform 335
Using a table/query to create the subform 335
Using an ActiveX control 335
Just the facts 336
V Creating Reports 337
15 Creating a Report 339
Reports versus forms 339
Choosing a report type 340
Creating a report 341
Designing the report 342
Mapping information to the sketch 342
Identify printing requirements 343
Test pieces before assembling 343
Understanding sections of a report 344
Understanding how reports are printed 346
Using the Report wizard 346
Creating a report 347
Adjusting the report 351
Using a Blank Report 352
Using the Report Design tool 355
Creating a report using the Report Design tool 355
Inserting a Group Header and Footer 356
Inserting a Report Header and Footer 358
Inserting page numbers 359
Entering a date and time 359
Growing and shrinking controls 360
Just the facts 361
16 Enhancing and Printing a Report 363
Creating labels 363
Creating a mail merge report 367
Setting the page layout and size 370
Trang 20Using images on a report 372
Modifying the Image control’s settings 373
Inserting a logo 374
Inserting a watermark 374
Using Snapshot Reports .375
E-mailing your report 376
Creating a PDF file 376
Inserting page numbers, date, and time 376
Using lines and rectangles 378
Just the facts 379
17 Generating Charts and Graphs 381
Choosing the correct chart and graph 381
Identify your message 382
Labeling the chart 382
Making your choice 383
Avoiding common mistakes 384
Tell what your message means 385
Creating charts and graphs 385
Getting started creating a chart 385
Building your chart 386
Editing the chart 388
Converting the chart to an image 389
Modifying the chart 389
Just the facts 390
VI Working with Macros 391
18 Creating a Macro 393
Finding out about macros 393
Setting conditions 394
Embedding a macro 395
Creating a macro 395
Making a standalone macro 396
Making a macro group 398
Running a macro 399
Running a macro in an event 401
Choosing an event 402
Assigning a macro to an event 402
Setting a condition for an action 404
Creating a condition for an action 405
Making decisions within a macro 406
Trang 21Debugging a macro 407
Using debugging tools 408
Using the Single Step tools .409
Using the SingleStep action 409
Modifying a macro 410
Just the facts 411
19 Using Macro Actions 413
Interacting with the database 413
Working with the OpenTable action 414
Running a query .414
Outputting data 414
Selecting an object 415
Finding data .416
Finding the next record .417
Making a record the current record 417
Using a query or a filter 418
Removing filters 418
Interacting with forms, reports, and controls 419
Opening a form 419
Selecting a control 420
Selecting a page .420
Displaying and printing a report 420
Interacting with windows 421
Maximizing, minimizing, and restoring a window .421
Moving a window .422
Importing and exporting 422
Transferring text .423
Transferring to a spreadsheet .424
General actions 425
Beeping 425
Display the hourglass 425
Stopping a macro 426
Cancelling an event .426
Closing an object .426
Turning off warnings 427
Hiding the results of the macro 427
Setting the value of a field, control, or property .427
Printing an object .428
Transmitting keystrokes .429
E-Mailing an object .429
Running an application from with in Access 2007 430
Running VBA code .431
Just the facts 431
Trang 22VII Database Administration 433
20 Managing and Maintaining a Database 435
Understanding garbage information 435Preventing garbage from entering the database 436
Locating the source of the data 437 Identifying potential sources for errors 437 Devising solutions to reduce errors 438
Minimizing data-entry errors 438Designing the paper form 439Minimizing text information 439Testing for common sense 439Encouraging review of information 440Scheduling backups 440
Backing up the database 441 Restoring a backed-up database 442
Compacting the database 442
Increasing performance 443 Defragging your database 443 Purging the information 444 Compacting the database 444
Using database properties 445
Exploring database properties 446 Using the Summary properties 447 Using the General properties 447 Using the Statistics properties 447 Using the Contents tab 447 Using the Custom tab 448 Creating a customized property 448 Deleting a customized property 448
Dealing with a growing database 449
Understanding lightweight and heavyweight objects 450 Understanding cleanup 450 Shrinking VBA code 451 Giving your database a thorough cleaning 451
Repairing a corrupt database 452Just the facts 453
21 Securing a Database 455
Securing your database 455
Using the Trust Center 456 Looking inside the Trust Center 457 Working in disabled mode 457 Using add-ins 458 Enabling a disabled object 458
Trang 23Using a database in trusted mode 458Understanding the concept of a trusted location 459Creating a trusted location 459Placing your application in a trusted location 461Packaging and signing an application .461
Creating a signed package .462 Using a signed package 463 Enabling disabled content 464
Using encryption 464
Encrypting your database 465 Removing a password 466
Just the facts 467
22 Working with SharePoint Sites 469
Looking at SharePoint 469Document Libraries and Shared Workspace 471
Peeking inside the Document Library 472 Creating a Document Library 473 Uploading a document in a Document Library 474 Checking out a document from a Document Library 475 Returning a document to the Document Library 475 Deleting a document from the Document Library 475 Creating a shared workspace 476
Moving the database to the SharePoint site .477Troubleshooting transfer problems 478
Importing from a SharePoint site 478 Exporting to a SharePoint List 479
Just the facts 479
VIII Programming with VBA 481
23 Creating Modules 483
What is a module? 483Types of procedures 485
Sub procedures 485 Function procedure 485
Passing parameters 486
Declaring parameters 487 Parameter data type 487 Parameter name .487 Supplying missing data 487 Calling a sequence of subs and functions 488
Trang 24Categories of modules 488
Using standard modules 489 Using Form/Report modules 489
Creating a module and procedures 489
Testing your procedure 491 Compiling procedures 491 Changing the name of the module 492 Saving the module 492 Opening a saved module 492
Creating procedures in a form/report 492
Create a simple form 493 Creating and linking a procedure to the control 493 Modifying an existing event procedure 495 Deleting a procedure 495
Comparing macros to procedures 496
Replicating a macro in a procedure 497 Actions that can’t be called from a procedure 497 Converting a macro to VBA 498
Just the facts 500
24 Writing VBA Code 501
Before writing your first instruction 501
Making a plan 502 Using pseudo code .503
Using literals, constants, and variables 504
Working with constants 505 Working with variables 505
Declaring a variable 506Naming a variable 508Using the scope of the variable 509Using an array 510Using Private and Public 513Hidden problems with public variables 514Handling the public variables 514Expressions and statements 515
Looking inside an expression 515 Using operators 515 Using operands 517 Using properties of an object 518 Using field values of a table 519
Creating an expression 519Creating statements 521
Using statements to declare a variable 521 Assigning values 521
Trang 25Working with values on a form 522 Creating the procedure 523 Changing the value of a property 525
Letting Access 2007 make decisions 526
Using the If Then End If statement 526
Using the Else statement 527Nesting If Then End If statements 528Using multiple conditions 528
Using the Select Case statement 529
Repeating statements without a lot of code 531
Using the Do Loop 531
Using the Do While Loop 532Using the Do Loop While loop 532Using the Do Until Loop 533Using the Do Loop Until loop 533Using the Exit Do statement 534
Using the For Next statement 534
Passing parameters to a procedure 536
Declaring an argument 536 Using an argument 537 Passing a value to a procedure 537 Working with multiple arguments 537
Returning a value from a function procedure 538Just the facts 539
25 Using Built-In Functions 541
Working with built-in functions 541
Identifying built-in functions for your procedure 542 Categories of built-in functions 543
Manipulating strings 543
Finding a series of characters in a string 543 Copying characters from a string 545 Trimming spaces 547 Changing the case of a string 548 Inserting spaces the easy way 548 Formatting a string 549
Working with numbers 550
Rounding a number 551 Removing the sign from a number 551 Generating a random number 552
Building the game form 553Writing the procedure 554Playing the game 556Using dates and times 556
Trang 26Converting from one data type to another 558
Converting a string to a number 558 Converting a number to a string 559 Converting dates 559
Working with records 560
Looking up data 560
Creating the procedure 562Displaying the search result 563
Counting records 564 Tallying records 565
Using built-in functions for programming 565
Using the IFF() function 566 Using the IsNull() function 566
Just the facts 567
26 Using SQL in a Procedure 569
Understanding SQL 569Creating a model procedure 570
Retrieving data from a database 570
Using the model procedure 570Working with a recordset 572
Modifying records 573
Selecting data from a table 574
Selecting from multiple tables 575 Using an alias 576 Retrieving specific records 576 Selecting all fields 577 Specifying multiple conditions 577 Selecting a range of values 578 Matching partial values 578 Finding blank fields 579 Getting rid of duplicates 579 Selecting several values the easy way 580
Joining tables 580Calculating data in an SQL query 581Grouping and ordering data 582
Using the GROUP BY clause 582 Limiting records within a group 583 Using the ORDER BY clause 583
Inserting a record into a table 585Updating records in a table 586
Updating multiple fields 587 Updating using calculations 587
Deleting a record from a table 587Just the facts 588
Trang 27IX Appendixes 589
Appendix A: Glossary 591 Appendix B: Using Standard Naming Conventions 607 Appendix C: Access Database Limitations 613 Index 617
Trang 29have a copy of Access 2007 on your computer as part
of an upgrade and want to quickly get up to speedusing it or because you want to enhance your MicrosoftOffice skills by learning how to use Access 2007
Chances are also good that other books on Access 2007either tell you more than you ever wanted to know aboutAccess 2007 or not enough for you to get your job doneefficiently
I write the kind of books that I like to use A book thatgives a brief but to-the-point explanation of what needs to
be done to achieve my desired result and then immediatelyjumps to the steps I need to perform to complete my task Judging by the size of the book you probably realize thisisn’t a compendium of all the features in Access 2007.There are many more features in Access 2007 than what Icover in this book These you’ll rarely use and are specifi-cally designed for high power Access 2007 developers Andthere are plenty of books on the market that show how touse these features Pick up one of them if you find a need
to span your horizons beyond features that I show you inthis book
When you’re at work and need a quick reminder onhow to do something in Access 2007 more easily and faster,grab hold of this book I do when something puzzles mewhen building an Access 2007 application
Trang 30Getting in and out
Microsoft Access has undergone a complete makeover With a new lookand feel – the Ribbon replaces menus Take a moment for a look-see, kickthe tires, and take Access 2007 for a spin Access 2007 is new so don’t skip
a chapter even if you currently use a previous version of Microsoft Access
If you do, you’ll be lost and miss out on many timesaving new features
All about data and designing a database
Begin your transformation from a mere mortal database user to a base application developer by learning how to organize data into so yourdatabase application can find that one piece of data you want fromamongst millions in a split second Chapters in this part show how to getyour data into topnotch shape
data-Tables are at the heart of your database design because this is whereinformation is stored, organized, and retrieved Sure I’ll show you how tocreate a table That takes about five minutes to do and you didn’t need tobuy a book to learn this because you can find out how to do it yourself
by poking around Access 2007 or surfing the Web
The big deal is that I show you the smart way to create and use tables.These are the tips and tricks that I picked up from using Access 2007 Ialso show you how to filter unwanted records and sort records trapped by
a filter Then you find out how to trade data electronically with cally any application Your colleagues will look to you as the whiz of tablesafter you read the tables chapters
practi-Creating Queries
You have a Jeanie who answers all questions Well, kind of a Jeanie It iscalled Access 2007 Access 2007 can tell you the product that will makeyou the most money — assuming the right data is in the database.Picking a winning lottery number? Access 2007 leaves that up to a realJeanie
Ask Access 2007 your question correctly in a form of a query And like
a real Jeanine Access 2007 answers it in seconds — minus the the-eye and a puff of smoke I’ll show you how to write questions and askAccess 2007 to answer them in the query chapters
Trang 31blink-of-Designing and using forms
A form is the face of your Access 2007 database application It is wheredata is entered and displayed It is used to interact with your applicationmuch like the form you use to complete a transaction at the ATMmachine
Creating a form is easy to do However, creating a form that makes
your database application easy to use and that gets a wow from the person
using it requires a little know-how and a few tricks to dress-up your base application I call this dressing for success I’ll show you how todesign and create forms and add bells and whistles that you expect in aprofessional database application in the forms chapters
data-Designing and using reports
The paperless office that so many of us expected hasn’t materialized.Although e-mails dramatically reduce demand for paper, I’m forevergoing to meetings and being handed a hard copy of a report and thentold the report is also being e-mailed to me
Paper reports will be around for a while, but that shouldn’t be yourconcern because Access 2007 can generate practically any report thatyou can imagine — even reports that can be viewed on the screen Restassured that I’m not going to show you how to create the blah, dull, andunimpressive reports that you probably receive all the time from yourcolleagues I show you ways to insert pizzazz into your report — pizzazzthat you won’t find on the Access 2007 Ribbon These are reports thatinclude charts, graphs, crosstabs, and pictures, too! I share with youthese techniques in the report chapters
Automate your database application
You probably used an application where you pressed one button and theapplication performed a bunch of tasks automatically I show you how tocreate an Access 2007 database application that does this
You come up with the tasks to automate, and I show you how to write
a macro that automates those tasks in the macro chapter A macro is like a computer program, but it’s much easier to write than a computerprogram
Trang 32Managing and maintaining your database
Garbage in garbage out A poorly managed and maintained databasegenerates garbage, unreliable information that gives the appearance ofrespectability but is really junk information You cannot prevent garbageinformation from finding its way into a database, but there are steps thatcan be taken to minimize it I show you these steps in the managing andmaintaining your database chapter so you can implement them in yourAccess 2007 database application
Securing your database
The question you’re probably asking yourself is how secure is the data in
my Access 2007 database application? The answer depends on whether
or not you implemented security features that are available in Access
2007 Nothing guarantees that your database won’t be hacked However,you can place obstacles in the database that a hacker must overcome togain access to the information I’ll show you how to use the Access 2007security features to secure your Access 2007 database application in thesecurity chapter
Developing your database application with your colleagues
Developing an application collaboratively with colleagues invites the riskthat two of you work on the same component simultaneously There’s agood chance that the last person to save his or her changes overwriteschanges made by the other, since only one copy of the component issaved
Not a problem if you use SharePoint because an electronic librariantracks changes for you You’ll learn how to use SharePointwith youAccess 2007 database application projects in the SharePoint chapter
Making the most of this book
Every book in the Unofficial Guide series offers sidebars that are devised
to help you get things done cheaply, efficiently, and smartly Each takes adifferent approach to providing you with useful information about thematerial in the chapters Use them to educate, inform, and guide your
Trang 33way through the sometimes conflicting or confusing information vided by Microsoft
pro-1 Hacks:If you are comfortable with advanced techniques, the Hackssidebars will show you ways to get things done using more efficienttechniques or by using techniques that take you into the expert’srealm
2 Watch Out!:There are times when the route to success is flankedwith traps for the unwary The Watch Out! Sidebars warn you whenyou need to be open-eyed and sure-footed and provide you withguidance so you avoid potential harmful results
3 Bright Idea:If Watch Out! Sidebars point you away from danger,Bright Idea sides bars point you towards time, effort-, or money-saving techniques You don’t have to use these tips but they willreward you if you do
4 Inside Scoop:These sidebars give you real-world perspective and liftthe material from the theoretical to the practical Use them to guideyour own approach and choose which path is best for you
Trang 35Getting Started
Trang 37Getting In and Out
makeover It has a new name, Microsoft OfficeAccess 2007 to complement its new look and feel.The most noticeable change is that Ribbons now replacemenus Under the hood is the power to manage any datathat you can throw at it
Before you learn how to harness this power to createdatabase applications that the pros in IT will envy, take amoment for a look-see — kick the tires and take Access
2007 for a spin
Access 2007 is new, so don’t skip this chapter even if youcurrently use a previous version of Microsoft Access; other-wise you’ll be lost and miss out on many time-saving newfeatures
Starting Access 2007
Starting Access 2007 is the same as starting other grams Click the Windows Start button, then All Programs,and find the Microsoft Office entry Access 2007 is listedamong the other products that comprise Microsoft Office
pro-A faster, more efficient way to start the program is toadd the Access 2007 icon to your desktop, so you need only
to double-click the icon to open Access 2007, or placeAccess 2007 on the Quick Launch toolbar
Trang 38Start from the desktop
Some programs automatically place an icon on the desktop for you whenyou install the program, whether or not you want to launch the programfrom your desktop
To place Access 2007 on your desktop, follow these steps:
1.Create a shortcut in the Microsoft Office section of the All Programswindow
2.Highlight the Microsoft Office Access 2007 entry and right-click themouse button
entry of Microsoft Office Access 2007 appears in the Microsoft Officesection A 2 next to the name indicates that this is a shortcut entry
4.Drag and drop it to your desktop
To remove Access 2007 from your desktop, right-click the icon andselect Delete Although the icon is gone from the desktop, the entry isstill in the Microsoft Office section of the All Programs window
Start from the Quick Launch toolbar
The Quick Launch toolbar (see Figure 1.1) is to the right of the Startbutton and is a great time-saver when you have multiple programs open
at the same time that obscure the desktop Simply kick off Access 2007from the Quick Launch toolbar instead of digging through open screens
to find Access 2007 on your desktop
To place Access 2007 on the Quick Launch toolbar:
1.Create a shortcut for Access 2007 (see “Start from the desktop”)
You can remove Access 2007 from the Quick Launch toolbar by clicking the icon on the Quick Launch toolbar and then clicking Delete
Trang 39Figure 1.1 The Quick Launch toolbar on my taskbar.
The Access 2007 environment
You’ll find a lot of unfamiliar terms and objects in the Access 2007 scape if you’re new to Microsoft Access If you currently use MicrosoftAccess, you notice that the new landscape is much different than previ-ous versions
land-The first thing you notice is that there are no menus or toolbars.These items are a thing of the past and are replaced by tabs that containmany features that use to be found on menus This is a good thingbecause many time-saving features were overlooked, buried beneath lay-ers of menus
The Ribbon
The Ribbon (see Figure 1.2) is the area on top of the program windowwhere you choose commands Commands are grouped in a logical way Related commands are grouped into a tab For example, you’ll findall commands needed to design a page layout in the Page Layout tab.Many tabs are hidden until you need them to work on a task Theseare called contextual tabs So you won’t see the Page Layout commandtab if you are not designing a page layout
Figure 1.2 The Ribbon contains tabs that group together related commands.
Active command tab
Related commands
Name of current database Ribbon Command tabs
Office Access 2007
Trang 40A gallery (see Figure 1.3) is a control that shows what the commandcan do and the results of using the command For example, theMargin gallery control displays options for standard margins, such asNormal, Narrow, and Wide Each option displays measurements for thetop, bottom, right, and left margins and shows a thumbnail image ofthe margin
Figure 1.3 A gallery control for setting margins.
Quick Access toolbar
Some commands need to be handy You find these commands on theQuick Access toolbar (see Figure 1.4) in the upper-left corner of the win-dow next to the Office Button
Save, Print, and Undo are the default commands on the Quick Accesstoolbar They appear as small icons Simply click the icon to use thecommand
Inside Scoop
You might find that the Ribbon takes up too much screen space You can mize a Ribbon by double-clicking the name of a tab on the Ribbon Double-click the tab name again to maximize the Ribbon
mini-Inside
Scoop