referencing forms from other forms 
Author Message
 referencing forms from other forms

Hi, I have two forms, one is the main form and the other is a form which
will be spawned from the main form when a buttoin is pressed. The spawned
form is based on a class which I created myself. Now, I would actually like
to be able to reference the entire formset which contains the main form from
the spawned form. I've tried things like

do form spawnedForm with thisformset

and in the init method of spawned form I put

lparameters ParentFormSet
thisform.oParentFormSet = ParentFormSet

but this never seemd to work. thisform.oParentFormSet is always = .F.

Can anyone help, please?

Thanks



Sun, 22 Dec 2002 03:00:00 GMT  
 referencing forms from other forms
I am doing a similar thing, using hot keys to pop up other forms from a main
form. I am wondering why your spawned form is not already part of your
formset? Do you actually create multiple instances of them each time the
button is pressed or something? Otherwise, you could just add your spawned
form to the formset that the main one is in, and use show and hide to show
it when you hit the button.
your button would have something like: thisformset.childform.show in the
click

And the other(child form) has thisform.hide in the Ok button, or whatever.
They both exist within the same formset, and so both can reference
properties of the formset.

This is basically what I am doing to provide popup forms within my formset.


Quote:
> Hi, I have two forms, one is the main form and the other is a form which
> will be spawned from the main form when a buttoin is pressed. The spawned
> form is based on a class which I created myself. Now, I would actually
like
> to be able to reference the entire formset which contains the main form
from
> the spawned form. I've tried things like

> do form spawnedForm with thisformset

> and in the init method of spawned form I put

> lparameters ParentFormSet
> thisform.oParentFormSet = ParentFormSet

> but this never seemd to work. thisform.oParentFormSet is always = .F.

> Can anyone help, please?

> Thanks



Sun, 22 Dec 2002 03:00:00 GMT  
 referencing forms from other forms
what about thisformset.spawnedForm.show

Quote:
> Hi, I have two forms, one is the main form and the other is a form which
> will be spawned from the main form when a buttoin is pressed. The spawned
> form is based on a class which I created myself. Now, I would actually
like
> to be able to reference the entire formset which contains the main form
from
> the spawned form. I've tried things like

> do form spawnedForm with thisformset

> and in the init method of spawned form I put

> lparameters ParentFormSet
> thisform.oParentFormSet = ParentFormSet

> but this never seemd to work. thisform.oParentFormSet is always = .F.

> Can anyone help, please?

> Thanks



Sat, 28 Dec 2002 03:00:00 GMT  
 referencing forms from other forms
You could make both form of the same formset, and reference by
'thisformset.form',
You could keep them seperate, you then need to know the formsets name to
reference it,
if it is somewhat 'interactive' you could think about adding your class to
the formset on run time. (see help on Addobject)
you also could create a public variable that holds the name of the formset,
so you don't need to pass it.

anyhow, in your line it seems to me that you pass on the wrong parameter. I
didn't try, but the spawned form needs the
name. Not a reference to an object. Did you try ' do form spawnedform with
thisformset.name '?
You then probably find your parameter being filled with the name.

Reind


Quote:
> Hi, I have two forms, one is the main form and the other is a form which
> will be spawned from the main form when a buttoin is pressed. The spawned
> form is based on a class which I created myself. Now, I would actually
like
> to be able to reference the entire formset which contains the main form
from
> the spawned form. I've tried things like

> do form spawnedForm with thisformset

> and in the init method of spawned form I put

> lparameters ParentFormSet
> thisform.oParentFormSet = ParentFormSet

> but this never seemd to work. thisform.oParentFormSet is always = .F.

> Can anyone help, please?

> Thanks



Sun, 12 Jan 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Referencing the controls on a form from another form

2. referencing forms and their objects from other forms

3. Can't reference on forms properties from another form

4. Referencing Forms in a Formset

5. erroro referencing form object from report

6. Pass Array by Reference to Form?

7. Passing a reference from one form to another.

8. VFP - Referencing objects in another form??

9. Form array properties: passing by reference

10. VFP3 Referencing Forms

11. Referencing a form control from the main.prg

12. referencing forms

 

 
Powered by phpBB® Forum Software