Board index » delphi » Changing data between two Child forms!

Changing data between two Child forms!

Hi!

I have created two Child forms.
When the form1 is active and I write this line :

form2.edit2.text:=form1.edit1.text;

then I get the message that the edit2 field does not exist.
This is probably because the form2 isn't active.

How can I do this?

Please help!

Darko Loncar

 

Re:Changing data between two Child forms!


Do you have form2's unit name in the uses statement?

Rkr

Quote
Darko wrote:

> Hi!

> I have created two Child forms.
> When the form1 is active and I write this line :

> form2.edit2.text:=form1.edit1.text;

> then I get the message that the edit2 field does not exist.
> This is probably because the form2 isn't active.

> How can I do this?

> Please help!

> Darko Loncar

--
                   \|||/
                   /'^'\
                  ( 0 0 )
--------------oOOO--(_)--OOOo--------------
. Reid Roman                              .
. Delphi Programmer / Analyst             .
. TVisualBasic:=class(None);              .
. May the Source be With You              .
-------------------------------------------
. Auto-By-Tel (http://www.autobytel.com)  .
. Irvine, CA U.S.A                        .
. E-Mail : rkroman (at) pacbell (dot) net .
. or reidr (at) autobytel (dot) com       .
-------------------------------------------

Re:Changing data between two Child forms!


Quote
>Do you have form2's unit name in the uses statement?

Yes, I have!

Any other sugestions?

Darko Loncar

Re:Changing data between two Child forms!


How many edit controls are there on the form2?
Maybe replacement "form2.edit2.text" with "form2.edit1.text" solves the
problem?
Or you say it works when form2 is active, otherwise - no ? In this case
maybe form2 not only active but has not been created?
This MUST work.

Maks.

Darko ??? a ???? <71cdfk$t6...@as102.tel.hr> ...

Quote
>Hi!

>I have created two Child forms.
>When the form1 is active and I write this line :

>form2.edit2.text:=form1.edit1.text;

>then I get the message that the edit2 field does not exist.
>This is probably because the form2 isn't active.

>How can I do this?

>Please help!

>Darko Loncar

Re:Changing data between two Child forms!


Quote
Maks A. Mahota wrote in message <71clks$du...@pandora.alkar.net>...
>How many edit controls are there on the form2?
>Maybe replacement "form2.edit2.text" with "form2.edit1.text" solves the
>problem?
>Or you say it works when form2 is active, otherwise - no ? In this case
>maybe form2 not only active but has not been created?
>This MUST work.

>Maks.

I found a solution :
1. i close the form1.
2. In the OnActivate event I put the code Form2.edit2.text:=form1.edit.text;

This works but I can not send from the form1 to the form2.

Darko Loncar

Re:Changing data between two Child forms!


Quote
In article <71ck5l$1t...@as102.tel.hr>, "Darko" <lo...@bj.tel.hr> writes:
>Any other sugestions?

Where is the declaration of Form2 's "Edit1 : TEdit;" in the Form2 code. Is it
a Delphi IDE created control or have you created it yourself.

Where is the "Form2.Edit1.Text := Form1.Edit1.Text;" statement in the Form1
code.

Alan Lloyd
alangll...@aol.com

Re:Changing data between two Child forms!


Quote
>Where is the declaration of Form2 's "Edit1 : TEdit;" in the Form2 code. Is
it
>a Delphi IDE created control or have you created it yourself.

I created it at design time.

Quote
>Where is the "Form2.Edit1.Text := Form1.Edit1.Text;" statement in the Form1
>code.

Its in a ButtonOnClick event.

Darko Loncar

Re:Changing data between two Child forms!


Sounds like the identifier's declaration is out of scope..

Rkr

Quote
Darko wrote:

> >Where is the declaration of Form2 's "Edit1 : TEdit;" in the Form2 code. Is
> it
> >a Delphi IDE created control or have you created it yourself.

> I created it at design time.

> >Where is the "Form2.Edit1.Text := Form1.Edit1.Text;" statement in the Form1
> >code.

> Its in a ButtonOnClick event.

> Darko Loncar

--
                   \|||/
                   /'^'\
                  ( 0 0 )
--------------oOOO--(_)--OOOo--------------
. Reid Roman                              .
. Delphi Programmer / Analyst             .
. TVisualBasic:=class(None);              .
. May the Source be With You              .
-------------------------------------------
. Auto-By-Tel (http://www.autobytel.com)  .
. Irvine, CA U.S.A                        .
. E-Mail : rkroman (at) pacbell (dot) net .
. or reidr (at) autobytel (dot) com       .
-------------------------------------------

Re:Changing data between two Child forms!


Quote
In article <71f4cq$hv...@as102.tel.hr>, "Darko" <lo...@bj.tel.hr> writes:
>>Where is the declaration of Form2 's "Edit1 : TEdit;" in the Form2 code. Is
>it
>>a Delphi IDE created control or have you created it yourself.

>I created it at design time.

>>Where is the "Form2.Edit1.Text := Form1.Edit1.Text;" statement in the Form1
>>code.

>Its in a ButtonOnClick event.

Darko

  Send me your code (the .PAS files and the .DFM files) - it sounds
inexplicable <g>.

Alan Lloyd
alangll...@aol.com

Other Threads