>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
thisform.NewObject("myQuery","sfquery","c:\ctsql\stone\sfquery\sfquery.vcx")
then you refer to it as thisform.myQuery.
thisform.RemoveObject('myQuery') && to remove.
However I think having it once in your form and calling its init might do :
thisform.SfQuery.Init
Cetin