You are here: Function Reference > Alphabetical Listing > S > SetEdit

SetEdit

Use this procedure/function to determine which field should be the next active field during normal entry. Normal entry refers to tabbing from field to field. If a user mouse clicks a particular field or pages between sections, the field selected by the SetEdit procedure is ignored. This procedure optionally returns one (1) on success or zero (0) on failure.

Syntax

SetEdit (Field, Count, Section, Form, Group)

Parameter

Description

Field

Enter the name of a field. The default is the current field.

Count

Enter a positive or negative number used to move beyond the field you specified. The default is zero (0).

Section

Enter the name of a section that contains the field named. The default is the current section.

Form

Enter the name of a form that contains the section and/or field named. The default is the current form.

Group

Enter the name of the form group that contains the form, section, and/or field named. The default is the current group.

This procedure first locates the specified field. If you omit the Field parameter, the system uses the current field.

You can use a positive or negative number for the count parameter. A positive count moves forward from the located field. A negative count moves backward from the located field. Forward and backward refer to the order in which the field appears in the section's edit list, not necessarily its physical position on the section. Do not include fields designated as display only in the count.

This procedure sets the next edit field each time the script executes. Therefore, use this procedure only in scripts that execute once during entry. Do not use the SetEdit procedure for scripts that execute each time a user tabs to a new field.

Note A DAL script executes once during entry. A DAL calc executes each time the user tabs to a new field. You make the DAL script or DAL calc designation in the Properties window.

This procedure returns one (1) if it finds the specified field. Otherwise, it returns zero (0).

Note The navigation logic you enter on the Navigation tab of the field’s Properties window overrides this procedure.

Here are some examples:

Assume the section has three fields named FIRST, SECOND, and THIRD. The fields occur in that order.

Procedure

Result

Explanation

SetEdit("THIRD")

1

Locates the field named THIRD on the current section. If found and if editable, that field will be the next field to receive focus.

SetEdit("THIRD".-2)

1

Locates the field named THIRD on the current section. If found, moves two fields prior to THIRD--to the field named FIRST.

SetEdit("MyField",,,
"FRM")

1 or 0

Locates the form named FRM in the current form group. Then locates MyField on that form. If found, focus changes to that form and field.

See also