|
Visual Basic for Applications (VBA) is the development language for Microsoft Access 2000. The core language, its constructs, and the environment are
the same in Microsoft Access 2000, Microsoft Visual Basic, Microsoft Excel, Microsoft Word,
Microsoft Outlook (for application-wide programming), and Microsoft Project.
What differs
among these environments are the built-in objects specific to each application. For
example, Access has a Current project object, but Excel has a Workbook object. Each application's
objects have appropriate properties (attributes) and methods (actions) associated with them
(and in some cases, events).
Unlike macros in Word or Excel, Access macros are not Sub procedures in modules; instead,
they are a different type of database object, with their own interface. Because of this, you can
use Access macros to learn to program in VBA, as you can by recording a Word or Excel
macro and then examining its VBA code. Simple Access applications can be written by using macros. Although macros are okay for
quick prototyping and very basic application development, most serious Access development
is done by using the VBA language. Unlike macros, VBA gives you the ability to do the
following:
. Work with complex logic structures (case statements, loops, and so on)
. Use constants and variables
. Take advantage of functions and actions not available in macros
. Loop through and perform actions on record sets
. Perform transaction processing
. Programmatically create and work with database objects
. Implement error handling
. Create libraries of user-defined functions
. Call Windows API functions
. Perform complex DDE and OLE automation commands
more...
|
|