Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
FormName Property Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Usage Notes
■ By default, Visual Basic defines the name of a form (FormName property)
as "Form" plus a unique integer, starting at 1. Numbers assigned are
cumulative - for example, Form1, Form2, and Form3. This yields a unique
name for each form.
■ To change the default, specify a unique name for the form. FormName must
start with a letter and can have a maximum of 40 characters, including
alphanumeric or underscore (_) characters.
■ A form name cannot be a Visual Basic reserved word.
See: ◄Visual Basic Reserved Words►
■ The FormName property is distinct from the Caption property. When you
change the caption, the FormName property is not changed.
■ Using the FormName identifier with properties and methods is optional
within a form's code section. Any reference to a form within its own
module or file is implicit. For example, in the code module for Form1:
Form1.PRINT "Hello"
is equivalent to:
PRINT "Hello"
■ Visual Basic syntax requires the FormName identifier when referring to
a form outside its own code section or a different module.
■ You cannot refer to the FormName property itself in code. For example:
FOO$ = Form1.FormName
causes an error. If you need to identify a form to pass to a procedure,
use the Tag property. See: ◄Tag Property►