What is a Naming Convention?
A Naming Convention is simply a standard rule (could be through the use of prefixes, suffixes, typographical convention (syntax styling) such as CamelCase, …) that you apply when creating names for :
- Objects
- Tables
- Queries
- Forms
- Reports
- Macros
- Modules (See VBA Components)
- Table Fields
- Controls (Forms & Reports)
- VBA Components (Modules, Class Modules) & Variables…
Why Use a Naming Convention?
Simple, to standardize your work and make it easier to follow.
For instance, take a simple example of
Public Sub Demo()
For cars = 0 To 10
Accident = DateAdd("d", cars, Date)
Debug.Print Accident
Next cars
End Sub
what is Accident and cars? Strings, Integer, Long, …?
Now, if you implement a basic naming convention and prefix all your VBA date variables with dt for Dates and i for Interger numbers you get
Continue reading