Wiley Microsoft Office Access 2007 All-in-One Desk Reference For Dummies 978-0-470-03649-5 ユーザーズマニュアル

製品コード
978-0-470-03649-5
ページ / 20
Chapter 1: What the Heck Is VBA?
In This Chapter

Understanding Visual Basic for Applications (VBA)

Using the Visual Basic Editor

Discovering code as you go
V
isual Basic for Applications — often abbreviated VBA — is a program-
ming language you can use to extend the functionality of Microsoft
Access and other products in the Microsoft Office suite of programs. A pro-
gramming language
is a means of writing instructions for the computer to
execute (perform). Programmers often refer to the written instructions as
code because the instructions aren’t in plain English. Rather, they’re in a
code that the computer can interpret and execute.
You can create sophisticated Access databases without using VBA at all. In
most cases, the other objects offered by Access — tables, queries, forms,
reports, and macros — offer more than enough flexibility and power to
create just about any database imaginable. But once in a while, you come
across a situation where you want to do something that none of those other
objects can do. That’s where VBA comes in. If you can find no other way to
accomplish some goal in Access, writing code is usually the solution.
Finding VBA Code
So what the heck is VBA code, anyway? To the untrained eye, VBA code
looks like gibberish — perhaps some secret code written by aliens from
another planet. But to Access, the code represents very specific instruc-
tions on how to perform some task.
Within any given database, Access stores code in two places:
✦ Class modules (Code-Behind Forms): Every form and report you create
automatically contains a class module (also called a code-behind form),
as illustrated in Figure 1-1. The class module for a given form or report
is empty unless you place controls that require VBA code on that form
or report.
38_036494 bk08ch01.qxp  11/17/06  8:34 AM  Page 571
COPYRIGHTED MATERIAL