Use the NewObject() method of the form. It's the same except you need to specify the property name to add it to. See Help for more details.
You can then use the RemoveObject() method to get rid of it.
HTH.
>I am using the sfquery.vcx class to create a filter on my data. Right now I just drop the sfquery.vcx onto the form and call it. The problem is it doesn't refresh it's fields listing if the data environment changes underneth it (I use sql2000 for the backend and no matter what query the user select, it assigns it to the same cursor name sqlresult). So to reset the filter, currently the user has to close the form and reopen it. I was thinking that if I added the sfquery with code, then I could drop it and readd it each time they pressed the filter button and it would hopefully reset.
>
>From the command window I can create the object using:
>
>oQuery=NewObject("sfquery","c:\ctsql\stone\sfquery\sfquery.vcx")
>
>But I'm not sure how to do this from within the form so it becomes an object of the form.
>
>Any help appreciated.
>
>Kirk
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao