** in the init of My Form Class ** I have created a property called FirstControl ** assined = '' from the begining LOCAL lnIndex lnIndex = 1000 FOR EACH oCtl IN THIS.CONTROLS IF PEMSTATUS(oCtl,'TabIndex',5) IF oCtl.TABINDEX < lnIndex lnIndex = oCtl.TABINDEX THIS.FirstControl = oCtl.NAME ENDIF ENDIF NEXTThen in my button class I put
** in the click of the button (New/Save & Edit/Cancel) LOCAL lFirst lFirst = EVAL("Thisform." + THISform.FirstControl) lFirst.SETFOCUSThanks So much