• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Introducing VBA 6.0

VBA is a real programming language, not a macro language. You can expect VBA to replace Access macros gradually—Microsoft recommends that you develop applications in Access by using VBA instead of macros. You create the preferred equivalent of macros with VBA functions and subprocedures. Although you can execute VBA subprocedures directly from an open code module, you more typically execute VBA subprocedures from user-initiated events, such as clicking a command button. (Chapter 28, "Responding to Events with VBA 6.0," explains how to use VBA subprocedures as event-handlers.) You execute VBA functions by calling them from calculated controls in forms and reports, from the Validation Rule property of a field or table, or from within a VBA subprocedure.

Where You Use VBA Code

Short VBA procedures using the DoCmd object usually are sufficient to provide the methods needed by simple applications to run queries, display forms, and print reports. The built-in functions of Access allow you to perform complex calculations in queries. You might want or need to use Access VBA code for any of the following reasons:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint