>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 >Thanks, I have saved this in my code folder and will make good use of it when needed.