Access 2007 VBA Programming For Dummies

by ;
Edition: 1st
Format: Paperback
Pub. Date: 2007-02-20
Publisher(s): For Dummies
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $31.49

Buy New

Arriving Soon. Will ship when available.
$29.99

Rent Book

Select for Price
There was a problem. Please try again later.

Rent Digital

Rent Digital Options
Online:1825 Days access
Downloadable:Lifetime Access
$21.60
$21.60

Used Book

We're Sorry
Sold Out

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

If you've been using Access for a while, you're probably aware of its power and potential and itching to take advantage of both. Access 2007 VBA Programming For Dummies takes you beyond forms and reports and shows you how to use VBA to create killer Access databases and applications. This gentle introduction to VBA programming covers everything you need to get started, including: Basic programming skills and concepts Explanations of modules, procedures, objects, and arguments Access-unique programming activities, including SQL and recordsets How to use the Visual Basic editor Creating dialog boxes, lists, drop-down menus, and functions Integrating with other Office applications Ready-to-use VBA code examples to type in or copy and paste from the Web Completely revised to reflect all changes found in Microsoft Access 2007, Access 2007 VBA Programming For Dummies gives you access to Access like you've never had it before.

Author Biography

Joe Stockman is an independent consultant, software designer, and author who has been using Microsoft Access since its initial release. He’s also developed courseware and taught classes in Access and VBA. Joe developed his first application in Access, and then migrated into Visual Basic and VB.NET, where he specializes in creating applications for the Windows Mobile platform. He worked for several software companies before forming his consulting business in 2002, where he deals with all types of clients including healthcare, financial, government, manufacturing, and small business. His ability to turn his customers’ wishes into working applications keeps them satisfied. Joe’s also writing the fundamentals column for the Advisor Guide to Microsoft Access magazine.

Alan Simpson is the author of over 100 computer books on databases, Windows, Web site design and development, programming, and networking. His books are published throughout the world in over a dozen languages and have millions of copies. Alan has also taught introductory and advanced computer programming courses at San Diego State University and the UCSD Extension. He has served as a consultant on high-technology, educationoriented projects for the United States Navy and Air Force. Despite that, Alan has no fancy job title because he has never had a real job.

Table of Contents

Introductionp. 1
About This Bookp. 1
Conventions Used in This Bookp. 2
What You're Not to Readp. 2
Foolish Assumptionsp. 3
How This Book Is Organizedp. 3
Introducing VBA Programmingp. 3
VBA Tools and Techniquesp. 3
VBA, Recordsets, and SQLp. 4
Applying VBA in the Real Worldp. 4
Reaching Out with VBAp. 4
The Part of Tensp. 4
Icons Used in This Bookp. 4
Web Site for This Bookp. 5
Where to Go from Herep. 5
Introducing VBA Programmingp. 7
Where VBA Fits Inp. 9
Taking a Look at Accessp. 10
Understanding VBAp. 11
Seeing Where VBA Lurksp. 12
Finding standard modulesp. 13
Finding class modulesp. 13
From VBA to Accessp. 15
Finding Out How VBA Worksp. 17
Discovering VBA proceduresp. 17
Recognizing VBA proceduresp. 18
Your VBA Toolkitp. 21
Using the Visual Basic Editorp. 21
Using Project Explorerp. 23
Using the Properties windowp. 24
Using the Immediate windowp. 26
Using the Code windowp. 27
Referring to Objects from VBAp. 29
Setting References to Object Librariesp. 30
Using the Object Browserp. 30
Searching the Object Libraryp. 33
Jumpstart: Creating a Simple VBA Programp. 35
Creating a Standard Modulep. 35
Creating a Procedurep. 36
Understanding Syntaxp. 38
Getting keyword helpp. 40
Help with argumentsp. 43
About named argumentsp. 45
Using Existing Codep. 46
Copy and paste code from the Webp. 46
Importing modulesp. 47
Modifying existing codep. 48
VBA foots and Techniquesp. 49
Understanding Your VBA Building Blocksp. 51
Commenting Your Codep. 52
Understanding VBA Data Typesp. 53
Passing Data to Proceduresp. 54
Storing data in variables and constantsp. 57
Storing data in arraysp. 58
Module-level versus procedure-levelp. 60
Naming conventions for variablesp. 61
Repeating Chunks of Code with Loopsp. 62
Using Do...Loop to create a loopp. 62
Using While...Wend to create a loopp. 64
Using For...Next to create a loopp. 64
Making Decisions in VBA Codep. 66
Using If...End If statementsp. 67
Using a Select Case blockp. 68
Controlling Access through VBAp. 71
Understanding Object Modelsp. 72
Distinguishing between objects and collectionsp. 72
Understanding properties and methodsp. 75
Identifying the icons for objects, properties, and methodsp. 77
Manipulating Properties and Methodsp. 79
Getting the value of a propertyp. 79
Changing the value of a propertyp. 81
Using an object's methodsp. 82
Seeking help with properties and methodsp. 84
Programming Access Formsp. 87
Working with Class Proceduresp. 87
Enabling or Disabling Form Controlsp. 90
Using VBA to position the cursorp. 91
Choosing an object and event for the codep. 92
Showing and hiding controlsp. 95
Making controls read-onlyp. 96
Responding to Form Eventsp. 96
Changing the Appearance of Objectsp. 99
Changing colorsp. 99
Controlling boldface, italics, and suchp. 103
Changing special effectsp. 104
Using the With...End With statementsp. 104
Filling form controls with datap. 105
Opening and Closing Formsp. 107
Closing a formp. 109
Adding a related record to another tablep. 109
More DoCmd methods for formsp. 112
VBA, Recordsets, and SQLp. 115
The Scoop on SQL and Recordsetsp. 117
What the Heck Is SQL?p. 117
Writing SQL without knowing SQLp. 120
Select queries versus action queriesp. 121
Getting SQL into VBAp. 123
Hiding warning messagesp. 124
Storing SQL statements in variablesp. 125
Creating Tables from VBAp. 128
Creating new tables from existing tablesp. 128
Creating a new, empty table from VBAp. 129
Closing and deleting tables through VBAp. 130
Adding Records to a Tablep. 131
Appending a single record with SQLp. 132
Query to append one recordp. 133
Changing and Deleting Table Recordsp. 134
Performing an Action Query on One Recordp. 136
Working with Select Queries and Recordsetsp. 137
Defining a connectionp. 140
Defining the recordset and data sourcep. 141
Filling the recordset with datap. 142
Managing recordsetsp. 143
Referring to fields in a recordsetp. 145
Closing recordsets and collectionsp. 146
Putting Recordsets to Workp. 147
Looping through Collectionsp. 147
Using For Each loopsp. 149
Using shorter names for objectsp. 152
Tips on Reading and Modifying Codep. 154
Square brackets represent namesp. 154
Other ways to refer to objectsp. 155
The continuation characterp. 157
Skipping Over Used Mailing Labelsp. 159
Looking at How SkipLabels Worksp. 162
Passing data to SkipLabelsp. 164
Declaring variablesp. 165
Copying the label reportp. 165
Getting a report's recordsourcep. 165
Creating the recordsetp. 166
Creating LabelsTempTable from MyRecordSetp. 166
Calling a Procedure from an Eventp. 171
Applying VBA in the Real Worldp. 173
Creating Your Own Dialog Boxesp. 175
Displaying and Responding to Messagesp. 176
Asking a questionp. 176
Designing a message boxp. 177
Responding to a MsgBox button clickp. 180
Converting Forms to Dialog Boxesp. 182
Storing dialog box settingsp. 183
Setting form propertiesp. 184
Adding controls to the dialog boxp. 187
Creating Custom Combo Boxesp. 189
Creating a Spin Box Controlp. 195
Detecting a Right-Clickp. 198
Customizing Combo Boxes and List Boxesp. 201
Programming Combo and List Boxesp. 202
Listing field namesp. 204
Listing text optionsp. 207
Listing Table/Query field valuesp. 212
Linking Listsp. 216
Running code when a form opensp. 218
Running code when the user makes a choicep. 219
Linking Lists across Formsp. 222
Updating a combo box or a list boxp. 223
Opening a form to enter a new recordp. 225
Seeing whether a form is openp. 226
Getting forms in syncp. 227
More Combo Box Tricksp. 228
Using hidden values in combo and list boxesp. 228
Giving users a quick findp. 232
Avoiding retyping common entriesp. 235
Creating Your Own Functionsp. 239
The Role of Functions in VBAp. 239
Creating Your Own Functionsp. 241
Passing data to a functionp. 242
Returning a value from a functionp. 243
Testing a custom functionp. 244
A Proper Case Functionp. 245
Looking at how PCase() worksp. 247
Using the PCase() functionp. 248
A Function to Print Check Amountsp. 251
Using the NumWord functionp. 254
Looking at how NumWord() worksp. 256
Testing and Debugging Your Codep. 265
Understanding Compilation and Runtimep. 266
Considering Types of Program Errorsp. 268
Conquering Compile Errorsp. 269
Expected: expressionp. 271
Expected: end of statementp. 272
Expected: list separator or )p. 272
Dealing with Logical Errorsp. 274
Checking on variables with Debug.Printp. 275
Slowing down codep. 279
Getting back to normal in the Code windowp. 282
Wrestling Runtime Errorsp. 283
Responding to a runtime errorp. 283
Trapping runtime errorsp. 285
Writing your own error handlersp. 288
Reaching Out with VBAp. 293
Using VBA with Multiple Databasesp. 295
Client-Server Microsoft Accessp. 296
Importing from External Databasesp. 302
Linking to External Data through Codep. 304
Avoiding Multiple Tables and Linksp. 305
Creating Recordsets from External Tablesp. 308
Importing, Exporting, or Linking to Anythingp. 309
Using a macro to write the codep. 309
Quick and easy import/export/linkp. 312
Integrating with Other Office Applicationsp. 315
Accessing the Object Libraryp. 315
Exploring a program's object modelp. 317
Meet the Application objectp. 318
Connecting to other programsp. 319
Sending E-Mail via Outlookp. 320
Sending Data to Microsoft Wordp. 325
Creating the Word templatep. 325
Creating the Access formp. 327
Writing the merge codep. 328
Interacting with Microsoft Excelp. 334
Creating the worksheetp. 335
Creating a query and a formp. 336
Writing the Excel codep. 337
Copying a table or query to a worksheetp. 342
Running Excel macros from Accessp. 346
The Part of Tensp. 349
Ten Commandments of Writing VBAp. 351
Thou Shalt Not Harbor Strange Beliefs about Microsoft Accessp. 351
Thou Shalt Not Use VBA Statements in Vainp. 351
Remember to Keep Holy the VBA Syntaxp. 352
Honor Thy Parens and Quotation Marksp. 353
Thou Shalt Not Guessp. 354
Thou Shalt Not Commit Help Adulteryp. 354
Thou Shalt Steal Whenever Possiblep. 355
Thou Shalt Not Bear False Witness against Thy Object Browserp. 355
Thou Shalt Not Covet Thy Neighbor's Knowledgep. 356
Thou Shalt Not Screamp. 356
Top Ten Nerdy VBA Tricksp. 357
Open a Form from VBAp. 357
See Whether a Form Is Already Openp. 358
Refer to an Open Formp. 358
Move the Cursor to a Controlp. 359
Change the Contents of a Controlp. 360
Update a List Box or Combo Boxp. 360
Show a Custom Messagep. 361
Ask the User a Questionp. 362
Print a Reportp. 363
Get to Know the DoCmd Objectp. 364
Indexp. 367
Table of Contents provided by Ingram. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.