Hemangi


Hi,

How do i pass one variable value from one form to other , once it pass on to other form previous form should get release or disable so that next form only can be viewed.

i have tried using "do form with varbname " but previous form doesnt get disable when i write thisform.release in unload event of this form, and if dont want to use formset.

regards

Hemangi





Re: How to Pass parameter between forms ?

LeoLems


Hi Hemangi,

Do form forms\Myform With varx,vary is the correct syntax.

I think the form that you start is a modal form

So this is why your previous form doesn't close until the new form is closed..

Always try to use modeless forms, it works so much better..

Greetz, Leo







Re: How to Pass parameter between forms ?

MarciaAkins

Hemangi wrote:

How do i pass one variable value from one form to other , once it pass on to other form previous form should get release or disable so that next form only can be viewed. i have tried using "do form with varbname " but previous form doesnt get disable when i write thisform.release in unload event of this form, and if dont want to use formset.

You syntax for passing parameters to the child form is correct:

DO FORM<< Form Name >> WITH << Parameter List >>

is correct.

You also need a PARAMETERS statement in the Init() of the called form to deal with them.

This is untested and off the top of my head, but to close the calling form, what about passing a reference to the child form and let the child form release it like This:

DO FORM Childform WITH Thisform, << other parameters >>

Then you can have this code in the Init() of the called form:

LPARAMETERS toCaller, << Other Parameters >>

toCaller.Release()







Re: How to Pass parameter between forms ?

Hemangi

Thanks for reply

i have pass parameter to another form but it isn't work ,without creating formset how next form will recognise previous form

LPARAMETERS toCaller, << Other Parameters >>

toCaller.Release()

and also i am calling one .prg file with parameters from screen and after passing parameters i want to close screen and run prg which then display menu

Regards

Hemangi






Re: How to Pass parameter between forms ?

dni

May you show some code






Re: How to Pass parameter between forms ?

MarciaAkins

Hemangi wrote:

without creating formset how next form will recognise previous form

If you pass an object reference from the calling form to the called form, that parameter (toCaller in my example), is a reference to the previous form. You can use it to call methods of the previous form such as release() like this:

toCaller.Release()






Re: How to Pass parameter between forms ?

NILKAMAL

hi!

i am new in vfp and i am trying to create search form so please can u post code from your both form and (init method )

code) cos i don't understand about parameter pls help me

thanks

lavesh





Re: How to Pass parameter between forms ?

NILKAMAL

hi!

i am new in vfp and learn to create search form so can u post code for both form

thanks

neal





Re: How to Pass parameter between forms ?

MarciaAkins

NILKAMAL wrote:

i am new in vfp and i am trying to create search form so please can u post code from your both form and (init method )

code) cos i don't understand about parameter pls help me

You really should go to http://www.hentzenwerke.com/catalog/fund6.htm and get a copy of Fundamentals: Building Visual Studio Applications on a Visual FoxPro 6.0 Foundation. It is the best beginners' reference book I have ever seen. Even though it was written for version 6, the concepts still apply.

Now, to call a child form from a parent form and have the child release the parent you call the child form like this:

DO FORM My ChildForm WITH Thisform

Then, it the init() of the childform you have code like this:

LPARAMETERS toForm

toForm.Release()