Home > Language Reference > Appendices

Naming conventions for identifiers

All identifiers that designate a variable, a label, a procedure, an event, a class, or other entities must conform to the same naming convention:

The only exceptions affect field names in tables which are limited to 15 characters.

In a procedure name, an underscore indicates that the procedure is an event handler. In such a case, the left hand side part of the name indicates the class or the object instance that can raise the event, while the right hand side part of the name indicates the event to be caught. For example:

Private Sub Form_Load()     ' Catch the Load event raised by the parent class Form
Private Sub Button1_Click() ' Catch the Click event raised by Button1
Private Sub Button2_Click() ' Catch the Click event raised by Button2

Since you cannot raise or catch events in a module, you cannot use underscores in global procedure names. For the same reason, you cannot use underscores in event names. On the other hand, underscores can be freely used in classes, labels, variables or constants names.