>>I tried putting both of those commands into the form's queryunload and neither works. If the search object is showing, my form will not close until I close the search object.
>>
>>If it helps you to understand my situation, the search object is a toolbar with a textbox and a close button in it. My form will not close unless I select the close button on the toolbar first.
>
>In that case,
>
>this.removeobject("oSearch")
I thought about that too but it doesn't work.
What I ended up doing is in the form's queryunload, I recursively go thru all controls checking to see if it is a grid and then set the grid's custom property that stores a reference to the object to NULL. That seems to do it.