SetFocusToFirst() LOCAL lnControl, ; llRetVal, ; lnTabIndex *-- Sets focus to first control that is not disabled FOR lnTabIndex = 1 TO This.ControlCount FOR lnControl = 1 TO This.ControlCount *** EGL: 3/27/97 - Added checking for the existence of a SetFocus() method ** IF TYPE("This.Controls(lnControl).TabIndex") <> "U" IF TYPE("This.Controls(lnControl).TabIndex") <> "U" AND ; PEMSTATUS(This.Controls(lnControl), "SetFocus", 5) IF This.Controls(lnControl).TabIndex = lnTabIndex AND ; This.Controls(lnControl).Enabled This.Controls(lnControl).SetFocus() llRetVal = .T. EXIT ENDIF ENDIF ENDFOR IF llRetVal EXIT ENDIF ENDFOR RETURN llRetValJosé