Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table keeps filter after it's closed?

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
Hey there,

so i'm creating my own dataenvironment with several tables, one of which has a filter set. the DE closes with the form (a form class actually) and all tables close as they should. then i open the same table (the one that had the filter) into a different DE in a different form class, but the same filter is set!

i've stepped thru the program and made sure that the tables do, in fact, close. i even put a 'de.closetables()' call into the formclass.unload() event. but still, as soon as i open the table again in a different de, the filter is still set. is there some reasonable explanation for this?

thanks.
-- michael~
 
are you sure you have your data session set to private?
 
Then set filter to nothing each time u load ur form or each time u close it. aND DONE
 

setting the filter to nothing on form.unload() works, but that seems to be just a workaround for a problem that shouldn't exist.

i open the table into a de (programmatically with createobject(), not using the de designer), set a filter (this.thisde.otable.filter = 'filter'), do my work, then that de object gets destroyed with the form's close (i even tried issuing closetable() on form.unload() with no difference). the next time the table is opened in a completely different form with a different de, the same filter exists on the table.

can anyone tell me why this happens??

thanks,
-- michael~
 
Are you explicitly releasing the variable that holds your data environment? It may be that VFP is looking for a particular object name when it releases the form. Since you used creatobject for your de object, rather than the visual design tools, your variable may not be automatically released.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top