Naming Conventions


VBA is not a case-sensitive language. However, in the real world, it is going to need to interact with case-sensitive languages. For that reason, naming standards have been adopted by the programming community to minimize the possible problems with the interaction. They are easy to remember:

  • Everything in lowercase

  • Midword capitalization

  • No spaces

In programming terms, any name you assign to something (such as objects, variables, and so on) is called an identifier. Let’s say you want to use My Address Book as an identifier. Using the programming conventions, you would spell it like this: myAddressBook.

To help identify the type of object something is, you begin the object name with a three-letter prefix. Table 3-1 lists the prefixes used for Access objects.

Table 3-1: Object-Identifying Prefixes

Object

Prefix

Container

con

Document

doc

Field

fld

Form

frm

Group

grp

Index

idx

Macro

mac

Module

mod

Page

pag

Property

pty

Query

qry

Report

rpt

Table

tbl

User

usr

As an example, suppose you want to make myAddressBook a table. The naming convention would be tblMyAddressBook.

We will be working with these conventions all through the book.




Access VBA Programming
Microsoft Access VBA Programming for the Absolute Beginner
ISBN: 1598633937
EAN: 2147483647
Year: 2006
Pages: 214
Authors: Michael Vine

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net