Adding Code to Forms

Microsoft Access 2010 continues to provide support for VBA (Visual Basic for Applications) code, which is the programming language built into most of the Office 2010 programs, including Word, Excel, Outlook, and PowerPoint. Arguably, VBA code provides the Office application developer with the most flexible and extensible tools built into Office 2010. You can use VBA code to create almost any functionality imaginable, but it comes at a cost. The VBA language is fairly complex, and learning to write code and build high-quality programs often requires a tremendous amount of time and effort. Just learning the language and how to make it work in your application can be quite a daunting task for the novice Access user.

Although this lesson provides a brief overview of adding code to Access forms, Lessons 51 through 57 of this book are devoted to providing much more information about the VBA programming language. This lesson discusses building forms that utilize VBA code and provides some very basic examples of how to embed VBA code in forms using Access 2010.


To begin this lesson, it is assumed that you have a basic knowledge of forms in Access 2010 and how to design and use them. Although understanding the VBA programming language is not required for this exercise, the more you know about VBA code and its functionality, the easier it will be to apply this lesson to your own database applications. However, for this lesson, it is assumed that you do ...

Get Microsoft® Access® 2010 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.