PROCEDURE SetFirst * Sets focus to control with earliest TabIndex LPARAMETER toWhich LOCAL loCtl, loPag IF PCOUNT() < 1 toWhich = thisForm ENDif FOR EACH loCtl IN toWhich.Controls WITH loCtl IF .TabIndex = 1 .SetFocus() EXIT ENDif IF UPPER(.baseClass) = "PAGEFRAME" FOR EACH loPag IN .Pages IF loPag.PageOrder = .ActivePage thisForm.SetFirst(loPag) ENDif ENDfor ENDif ENDwith ENDfor ENDproc