Leszynski naming convention


The Leszynski naming convention is a variant of Hungarian notation popularized by consultant Stan Leszynski specifically for use with Microsoft Access development. Although the naming convention is nowadays often used within the Microsoft Access community, and is the standard in Visual Basic programming, it is not widely used elsewhere.
The conventions are derived from an earlier set of conventions, the Leszynski/Reddick naming conventions, originally developed in 1992 by Greg Reddick. Eventually, Leszynski and Reddick had different ideas about how the conventions should be developed, and split into two separate sets of conventions, the other being the RVBA Conventions.
As in all Hungarian notations, it uses prefixes to indicate the type of objects and database development fields. The general structure of Hungarian notation is to break down object names into the following elements:
BaseName
The tags are lower case and the object name is camel case. Spaces and underscores are not used.

Advantages

Since the Leszynski naming convention is a special form of Hungarian notation the same general advantages also apply to the Leszynski convention.
The use of distinctive prefixes makes your database self-documenting; when you see frmSales in VBA code, you will know that it references a form, and when you see curSales you will know that it is a Currency variable. When selecting a query from a drop-down list, you will know that a query starting with qmak is a make-table query, while one starting with quni is a union query. This information will allow you to avoid errors such as using the SetFocus method with a field, or trying to open a table.

Disadvantages

The elements of the naming convention are described in the following table.
ComponentDescriptionExample
PrefixA lowercase letter that adds extra information to the tagp for Public variable
TagA three-letter sequence indicating the object typetbl for table
BaseNameA word or two describing the object. If several words are used, each starts with a capital letter, and there are no spaces between themOutlookContacts – contacts imported from Outlook
Suffix, Qualifier A word giving more specific information about an objectByDate – the data is sorted by date

The Basic LNC Object Prefixes

The Basic LNC Variable Prefixes

The Basic LNC Database Object Tags

The LNC Table Field Tags

The LNC Tags for VBA Variables

The LNC Tags for Form and Report Controls

Some Typical LNC Names for Database Objects, Controls and Variables