FormName

Use this function to get the name from a form.

Syntax

FormName (Count, StartForm, Group)

Parameter

Description

Count

Enter an index reference to use to locate a form before or after the specified form. The default is zero (0).

Startform

Enter the name of the form from which to start the search. The default is the current form.

Group

Enter the name of a group that contains the form you specified. The default is the current group.

The system returns the name of the form it located.

Keep in mind you can use an asterisk (*) as the object name to match parent objects. This lets you find objects without explicitly knowing the parent names.

Note For optimal performance, avoid using wildcards (*) when searching for field, section, or form names.

The system lets you get the name of a form relative to a known form. If you omit all parameters, the system returns the name of the current form. The Count parameter moves a number of forms forwards or backwards (negative) from a located form before returning the form name.

If the starting form cannot be located or the Count parameter causes the system to move beyond the number of forms contained in the group, the system returns an empty string.

If there is more than one copy of the form, the name returned contains the occurrence notation used by DAL functions to locate forms. For instance, a name like FORM\3 identifies the third copy of FORM within the same group.

Example

Here are some examples:

(Assume there are three forms: FORMA, FORMB, and FORMC. Also assume the current form is FORMB.)

Function

Result

Explanation

FormName( )

FORMB

No parameters will result in returning the current form name.

FormName ( -1, "FormC")

FORMB

Locates FORMC in the current group. Then returns the name of the form that occurs before this form.

See also