* We need to make sure the hierarchy is not coming from a Valid() event * because this will generate an error * In Visual FoxPro 5, we are not allowed to call SetFocus() from a Valid() event LOCAL lcProgram,lnCompteur lcProgram=PROGRAM(1) lnCompteur=2 DO WHILE LEN(lcProgram)>0 lcProgram=EVALUATE('PROGRAM('+ALLTRIM(STR(lnCompteur))+')') lnCompteur=lnCompteur+1 IF UPPER(RIGHT(lcProgram,6))='.VALID' RETURN ENDIF ENDDO