SET DELETED is copsed to the dta session it is executed within. When you call a prg from your form the prg runs in the form;s data session. When you call a method of an object that exists the method code runs in the data session of that object (which may not be the same as the data session of your form). I handle these data session settings by using a class where in its Init it saves the current setting of all settings it will change and then makes the changes and in its destroy it resets all settings back to what it saved during its init. In my form class' load event I do a Thisform.oSettings = CreateObject("MySettingsClass") and in the form's destroy I do thisform.oSettings = NULL. Since the object created will always be living within the data session of the form it will alwasy affect the form's environment.