It doesn't really matter how you open them (you can also use Form.Load()): if the datasession is private, they should be opened and closed independently in both forms, almost as if each form were an independent user. Closing the table in one form (or closing the form, which closes the tables automatically in a private datasession) shouldn't affect the other form. Something is going wrong, but I don't know what. Perhaps the form is actually changed to the default datasession, for example. This may require some debugging.
>Hi
>I have 2 Modeless forms which set the datasession property to 2 (Private),
>Both of these 2 forms use the same customer file (cusmas.dbf),
>but I find that when I close one form, the customer file also closed in another form.
>
>How can I open and access the same file separately ?
>
>I just only write the open file coding in the DataEnvironment INIT event of the form as follow.
>
>
>USE CUSMAS IN 0 ALIAS cusmas
>SET ORDER TO CUSNO
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)