Name

The Name property returns the name used in code to identify a form, control, or data access object, and returns or sets the name of a font object. Read-only at run time.

Syntax

object.Name

The object placeholder represents an object expression that evaluates to an object. If object is omitted, the form associated with the active form module is assumed to be object.

Remarks

The default name for new objects is the kind of object plus a unique integer.

An object's Name property must start with a letter and can be a maximum of 40 characters. It can include numbers and underline (_) characters but cannot include punctuation or spaces. Forms cannot have the same name as another public object such as Clipboard, Screen, or App. Although the Name property setting can be a keyword, property name, or the name of another object, this can create conflicts in your code.

Note Although Visual Basic often uses the Name property setting as the default value for the Caption, and Text properties, changing one of these properties does not affect the others.