LOCAL llGridFound, loItem *-- Define local variables llGridFound = .f. loItem = .NULL. *-- Iterate through the objects in the form FOR EACH loItem IN THISFORM.Objects *-- If the HSGRID1 control is there, *-- set the flag and exit the iterative loop IF UPPER( loItem.Name ) = "HSGRID1" llGridFound = .T. EXIT ENDIF && UPPER( loItem.Name ) = "HSGRID1" ENDFOR && EACH loItem *-- Now, check for the flag *-- and instantiate the class *-- if it's not there IF !( llGridFound ) THISFORM.AddObject( "hsgrid1", "grid" ) ENDIF && !( llGridFound )Obviously, you could make this into a more generic "common code" method by passing in the control name that you're looking for rather than hard-coding the HSGRID1 -- and you could do the same thing to instantiate a different class rather than the base grid, yada yada...