Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Cheryl B
  Where is Cheryl B?
 Xenia
 Ohio - United States
 Cheryl B
 Tags
Subject: RE: Calling a form from another form
Thread ID: 787 Message ID: 793 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Thursday, June 14, 2001 9:32:44 AM         
   


Cheryl,

First of all I would add a property to the main form, this an Array named "alinkedforms"
adding this means that you have to define it as an array.
So open the form in the menu choose Form->New Property and as a name type in:
aLinkedForms[1,1]

Next: Opening the form of your choice would need some code:
Like these three lines

lnIndex = ALEN( THISFORM.aLinkedForms)+1
DIMENSION THISFORM.aLinkedForms[lnIndex]

DO FORM NAME THISFORM.aLinkedForms[lnIndex] LINKED WITH THISFORM

whenever you would close the main form you want the 'childform' to disappear as well.
here is the code to do so:
QueryUnload is the method to place this code:

FOR lnI = 1 TO ALEN(THIS.aLinkedForms)
IF TYPE('THIS.aLinkedForms[lnI]') = 'O' AND !ISNULL(THIS.aLinkedForms[lnI])
*
* Check if it can unload
*
llReturn = llReturn AND THIS.aLinkedForms[lnI].QueryUnload()
IF llReturn
*
* Release it
*
THIS.aLinkedForms[lnI].Release()
ELSE
*
* Unable to release so activate it
*
THIS.aLinkedForms[lnI].Show()
EXIT
ENDIF
ENDIF
ENDFOR

Hope this'll help you out.

Good luck
In style with a smile and a good choice of voice
Boudewijn

ENTIRE THREAD

Calling a form from another form Posted by Cheryl Bellucci @ 6/14/2001 8:59:39 AM
RE: Calling a form from another form Posted by Boudewijn Lutgerink @ 6/14/2001 9:32:44 AM
RE: Calling a form from another form Posted by Cheryl Bellucci @ 6/14/2001 1:56:55 PM
RE: Calling a form from another form Posted by Ryss Unger @ 6/14/2001 2:37:26 PM
RE: Calling a form from another form Posted by Cheryl Bellucci @ 6/14/2001 2:53:15 PM
RE: Calling a form from another form Posted by Ryss Unger @ 6/14/2001 4:08:34 PM
RE: Calling a form from another form Posted by Dale Dedoroy @ 6/14/2001 10:54:17 PM
RE: Calling a form from another form Posted by Boudewijn Lutgerink @ 6/14/2001 11:30:26 PM
RE: Calling a form from another form Posted by Cheryl Bellucci @ 6/15/2001 1:30:10 PM
RE: Calling a form from another form Posted by Eric den Doop @ 6/15/2001 7:50:48 PM