• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 27. Learning Visual Basic for Ap... > Getting Acquainted with VBA 6.0

Getting Acquainted with VBA 6.0

VBA is a real programming language, not a macro language. 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 or changing the current record of a bound form. (Chapter 28, “Handling 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 value 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 Access-specific DoCmd object lets you run any macro action from VBA as a method of the DoCmd object. For example, executing DoCmd.OpenForm("FormName") opens the FormName form.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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