>The Environments:
>
>I have a form frmMyForm with a grid. The grid RecordSource = Batch, RecordSourceType = 1-Alias. (Batch is a table part of the database).
>Batch is added to the Data Environment of frmMyForm.
>When I run the program, the grid contains records from Batch.
>
>The Problem:
>
> Sometimes when I do frmMyForm.Release and Several screens later DO FORM frmMyForm, the grid is blanked out. The reason
>is because Batch is not in the data session. I did not close Batch
>in anyway and sometimes it's closed when I release frmMyForm.
>
>The Question:
>
> How can I get Batch to stay open regardless of whether I release
>frmMyForm? Shouldn't Batch be opened everytime frmMyForm is called
>since Batch is part of frmMyForm's Data Environment??.....
If you set DE.AutoOpenTables=.T. (default setting), then tables will be open automatically when you launch the form. However, you should be cautious not to include the same tables into DE of different forms if they use default data session, because DE will also close all its tables when closing if DE.AutoCloseTables=.t.
Edward Pikman
Independent Consultant