FOR lnCount = _screen.FormCount TO 1 STEP - 1 loForm = _screen.Forms[lnCount] IF PEMSTATUS(loForm, 'QueryUnload', 5) IF NOT loForm.QueryUnload() * We can not close the form llExit = .f. EXIT ELSE loForm.release() endif ELSE IF PEMSTATUS(loForm, 'Release', 5) loForm.Release() ENDIF ENDIF NEXTGives form is not an object on loForm = _screen.Forms[lnCount] line.