See Also
Applies To
All forms and controls, Database object,
Description
Specifies the name used in code to identify a form, control, or data access object. Not available at run time.
Remarks
The default name for new objects is the kind of object plus a unique integer. For example, the first new form is "Form1," a new MDI form is "MDIForm1," and the third text box you create on a form is "Text3."
An object's Name property must start with a letter and can be a maximum of 40 characters. It can include numbers and underscore characters but can't include punctuation or spaces. Forms can't have the same name as another global object such as Clipboard, Screen, or App. However, unlike Visual Basic 1.0, a name can be the same as a reserved word , property name, or the name of another object, but this can create conflicts in your code. For information on handling naming conflicts, see Chapter 6, "Programming Fundamentals," in the Programmer's Guide.
You can use a form's Name property with the Dim
You can't have two forms at design time with the same name. You can create an array of controls of the same type by setting the Name property to the same value. For example, when you set the name of all option buttons in a group to "MyOpt," Visual Basic assigns unique values to the Index property of each control to distinguish it from others in the array. Two controls of different types can't share the same name.
Note Although Visual Basic often uses the Name property as the default value for the Caption , LinkTopic , and Text properties, changing one does not affect the others.
For many of the Database objects, the Name property reflects the name as known to the Database, as in the name of a Table, Field, or QueryDef. There is no direct link between the name of the Database object and the object variable used to reference it. The name of the Dynaset or Snapshot is either the Name property of a Table or QueryDef used to create it, or the SQL statement used to create it.
Data Type
String
Help:
ActiveForm Property
Caption Property
Data Access
Dim Statement
Index Property (Control Arrays)
Index Property (Data Access)
LinkTopic Property
Me Reserved Word
Text Property
Programmer's Guide:
Chapter 3, "Creating and Using Controls"
Chapter 6, "Programming Fundamentals"
Chapter 20, "Accessing Databases with the Data Control"
Data Access Guide
Chapter 2, "Database Management Using Visual Basic"