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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form call a second form

Status
Not open for further replies.

samsam

MIS
Dec 23, 2001
6
0
0
SG
Hi,
Thanks for any help
I have two forms:form1 has grid1 and form2 has grid2.Form one call form2, my problem is when I close form2 I can not write in grid1 of form1.
Note:Two forms are not in formset.
 
samsam,

If these forms are both using the default datasession and form2 has the dataenvironment property AutoCloseTables set to .T. then when you exit form2 you are closing the table that the grid in form1 is using.

You will need to either set tehse forms to using a private data session so they don't step on each other or set form2 so it does not automatically close the table on exit (set AutoCloseTbales to .F.).

JimB

JimBooth
jbooth@jamesbooth.com
 
Hi,
Thanks for your reply.
I try private datasession but now I can't call 2nd form please can u exlpain me how can I use Datasession?
Don't tell me to refer to any i.e of Tastrade I see it but I don't understand any thing.
Thanks for your help.
 
Samsam,

A private data session allows a form to have its own data that is independent from any other forms that might be open. If you are trying to get form2 to use the data from form1 then you want form2 to have the default data session, but you want the autoclosetables property of the data environment of form2 set to .F. so it won't close the tables when form2 closes.



JimBooth
jbooth@jamesbooth.com
 
Hi,
Thanks for your reply and your help.
I try private datasession for both forms and autoclosetable property .F. but no result.
another suggestion many thanks for your attention.
 
Have you checked if your tables/views/cursors needed for your second form are opened in the datasession of the second form ??

If you use the data of your first form in the second form, then set the datasession of the first form to private and the datasession of the second form to default.

In this case the default datasession of the second form is the same as the datasession of the form that called the second form.

HTH,
Weedz (The Grassman)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Hi,
Thanks for your reply.
If I said u that my first datasession had 3tables: Customer, Product, Tab1 is free table and empty.The second datasession : Product, Tab1. So I try your suggestion but no result perhaps I forget any thing.
Many thanks for your attention.
 
You mention a second datasession, but in the mentioned example there should only be one datasession (if you wouldn't count the FoxPro default datasession), that is the datasession of the first form.

Have you checked your datasessions and what happens when you close form2. (are ables closed, howmany datasessions are there).

I suggest you take a look at the datasession. You can check it by typing SET in the command window.

Good luck,

Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Hi,
Many thanks for your help.
It goes to wonder your solution but now I copy table "Product" in free table "tab1" only the index "cod_art" to allow write "qt_liv" it has as recordsource "tab1" so the table isn't sorted I must use it and reindexed each time I carry out the application, and all record are displayed at the end of the grid1 in form1.How can I resolve this problem.
Many thanks for your attention.
 
Hi,
Any suggestion please, I'm greatfull for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top