Ok, I solved it.
It appears that only tables opened in the data environment are closed when the form is released. I checked some other forms where we are doing the same thing and the tables are staying open after the form is closed even though the form has a private datasession. You don't see them unless you select that datasession. I put the code below in my form Release method. I checked and at that point it is still in the private datasession. This gives us what we were assuming all along.
By the way, this might explain the random record locked problems we were having sometimes. That is what prompted me to look into this.
if thisform.DataSession = 2
Close Databases all
Close Tables all
endif
Thanks for the input guys,
John
>
>If the tables are opened in that session and session is released then tables are closed. It indicates that there is some dangling reference and your session is still alive (probably would show as "Unknown" if you check in VFP IDE.
>Cetin
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn