Changing Form Tab Focus

Set form tab focus from in the program by moving CRT-FOLDER-TAB-FOCUS to one form tab and CRT-FOLDER-TAB-RESET to the other tabs.

MOVE CRT-FOLDER-TAB-FOCUS TO ProgramCodeF1-LOC-TabName-TAB-AF
MOVE CRT-FOLDER-TAB-RESET TO ProgramCodeF1-LOC-TabName-TAB-AF

In the following example, when the Location form tab is active (set as the focus) when the user chooses the Inquire action, the program sets the focus to the Description form tab and resets all other tabs. If the Location form tab is not active when the user inquires, the program resets the focus to the Main form tab.

001083*************************************************************
001084 480-INQUIRE.
001085*************************************************************
001086     IF (GD01F1-LOC-LOCATION-TAB-AF = CRT-FOLDER-TAB-FOCUS)
001087       MOVE CRT-FOLDER-TAB-RESET
001088                             TO GD01F1-LOC-LOCATION-TAB-AF
001089                                GD01F1-LOC-MAIN-TAB-AF
001090                                GD01F1-LOC-ITEMS-TAB-AF
001091                                GD01F1-LOC-GUESTS-TAB-AF
001092                                GD01F1-LOC-COMMENTS-TAB-AF
001093       MOVE CRT-FOLDER-TAB-FOCUS
001094                             TO GD01F1-LOC-DESCRIPTION-TAB-AF
001095     ELSE
001096       MOVE CRT-FOLDER-TAB-RESET
001097                             TO GD01F1-LOC-LOCATION-TAB-AF
001098                                GD01F1-LOC-DESCRIPTION-TAB-AF
001099                                GD01F1-LOC-ITEMS-TAB-AF
001100                                GD01F1-LOC-GUESTS-TAB-AF
001101                                GD01F1-LOC-COMMENTS-TAB-AF
001102       MOVE CRT-FOLDER-TAB-FOCUS  TO GD01F1-LOC-MAIN-TAB-AF.

Form Tab Focus Considerations

  • Ensure that the focus status is correct by resetting all other tabs before setting focus to another tab. If focus is set to more than one form tab, only the last applies and results might be unpredictable.

  • When changing an item on a detail tab, to see the detail you must set the focus to the parent form tab; it is not automatically made active.