>Nancy,
>
>I was using FORM.AddObject and FORM.RemoveObject. I think The CreateObject() approach requires THISFORM.oRef=.NULL., but usually I release them (THISFORM.oRef.Release) before releasing the form. There was particular case with toolbars (which does not have a native Release method). One UT member susggested the use of UDF Release with THIS.Release in it.
>
>If you do not release the oRef prior to form exit, and if the form has a Private DS, then the DS does not release properly, as I found out.
>
>The AO/RO approach had problems with grids. RO didn't come up clean before AO is executed, so I got a "Object with same name already exist" message. It releases OK when all the code in the Valid had finished executing.
>
I think if you put the object reference into a form's user-defined property, say THISFORM.oRef, you do not need an explicit release (THSIFORM.oRef=.NULL.), but if this object was created into a PUBLIC var, then =.NULL. is required. THISFORM.oRef releases together with the form. Correct me if I'm wrong.
What I did was to poll for the presence of Form.Object (contained, not assigned to property). When an error occured, TYPE('Form.Object')='U', I assumed the object is properly released. It looks like this time round the approach that I used before no longer works.
Kenneth
Kenneth.