Skip to main content


Access VBA Programming For Dummies

Alan Simpson

ISBN: 978-0-764-57411-5 August 2004 408 Pages


  • This friendly, easy-to-use guide shows experienced Access users how to use
  • VBA (Visual Basic for Applications) to build Access databases and applications, but also covers programming fundamentals for nonprogrammers
  • Includes practical, ready-to-use VBA code examples that readers can type or copy and paste from the Web into their own database projects
  • Explains basic VBA skills and concepts for nonprogrammers, such as procedures, variables, and loops
  • Covers more advanced topics, such as record sets and other programming activities that are unique to Access programming
  • Author has written more than ninety computer books and has been working with databases since the early 1980s

Introduction 1

Part I: Introducing VBA Programming 7

Chapter 1: Where VBA Fits In 9

Chapter 2: Your VBA Toolkit 21

Chapter 3: Jumpstart: Creating a Simple VBA Program 35

Part II: VBA Tools and Techniques 49

Chapter 4: Understanding Your VBA Building Blocks 51

Chapter 5: Controlling Access through VBA 71

Chapter 6: Programming Access Forms 87

Part III: VBA, Recordsets, and SQL 115

Chapter 7: The Scoop on SQL and Recordsets 117

Chapter 8: Putting Recordsets to Work 147

Part IV: Applying VBA in the Real World 173

Chapter 9: Creating Your Own Dialog Boxes 175

Chapter 10: Customizing Lists and Drop-Down Menus 201

Chapter 11: Creating Your Own Functions 241

Chapter 12: Testing and Debugging Your Code 267

Part V: Reaching Out with VBA 295

Chapter 13: Using VBA with Multiple Databases 297

Chapter 14: Integrating with Other Office Applications 317

Part VI: The Part of Tens 349

Chapter 15: Ten Commandments of Writing VBA 351

Chapter 16: Top Ten Nerdy VBA Tricks 357

Chapter 17: (Way More Than) Ten Shortcut Keys 367

Index 371

Chapter 6 Source Code

Here you can download all the source code from this book. The files are organized by chapter. Please note that these samples are saved in a ZIP format archive. You can download the individual chapter or if you have a high speed internet connection, we have included all of the chapter files in one download file. To access them, you'll may need to install a program capable of reading ZIP format archives, such as WinZip or WinRAR.

Chapter 7 Source Code
Chapter 8 Source Code
Chapter 9 Source Code
Chapter 10 Source Code
Chapter 11 Source Code
Chapter 12 Source Code
Chapter 13 Source Code
Combined Chapters Source Code
Spin Buttons
A set of Rolodex-style buttons (see below) that users can click to quickly jump to any section of a lengthy table. After downloading, see the RolobuttonsExample form for an example. Then see the Instructions for Use form for instructions on adapting the buttons to your own database. (You only have to change one word in the VBA code!).
MOM 2003 Sample Database
Throughout the book you saw several sample forms used as examples (see below). All of those forms came from my MOM 2003 sample database. You can download that whole database. The zip file contains two versions: In version 1, all tables are empty, so you'll get off to a clean start on entering data. In version 2, you the database already contains some fake sample data, so you can explore its features without first entering data. Either version should work fine in Access 2000, 2002, and 2003.