Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference a form from another form
Message
De
18/04/1999 08:25:55
 
 
À
16/04/1999 18:55:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00207251
Message ID:
00209475
Vues:
24
Hi Ed,

I checked out the DATASESSION and it seems to be the same. I did a test using GOTO and that worked but my SEEK still fails.

This works (oHeader is a property of the modal form where in the init of the modal form I do a oHeader = lParm1)
GOTO RECORD 256 IN oHeader.Parent.Parent.RecordSource
oHeader.Parent.Parent.Refresh()

This fails to find the record even thought there are 20 John records
LOCATE FOR ALLTRIM(oHeader.Parent.Parent.RecordSource) = "John"

>>That sounds like what is happening. Do I need to use a form set or is there a way to insure that the modal form uses the same data environment?
>>
>
>I believe that a modal form using the default data session inherits the data session of its parent form. You can also explcitly pass the datasession to the child form and use SET DATASESSION TO
>
>>>>>>I am creating a form from a method in a grid with the following code
>>>>>>
>>>>>>*MyGrid.SearchForm()
>>>>>>LPARAMETER oHeader
>>>>>>oSearch = CREATEOBJECT("searchform", oHeader)
>>>>>>oSearch.Show()
>>>>>>
>>>>>>In the init of oSearch I have the following code
>>>>>>
>>>>>>*SearchForm.Init
>>>>>>PARAMETERS oHeader
>>>>>>This.Caption = "Search the " + oHeader.Caption + " Column"
>>>>>>
>>>>>>The above works fine.
>>>>>>
>>>>>>In the click of a command button on the modal form oSearch I have the following
>>>>>>
>>>>>>*SearchForm.Command1.Click
>>>>>>ThisForm.Text1.Value = oHeader.Parent.ControlSource
>>>>>>
>>>>>>When I click the command button I get the following error "Object oHeader not found".
>>>>>>
>>>>>>Why isn't oHeader visible in the command.click method?
>>>>>
>>>>>oHeader goes out of scope and disappears once the Init event completes; to make it available later, save it in a form property and use the form property to reference the object.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform