Cant Reference other Forms Properties 
Author Message
 Cant Reference other Forms Properties

Shouldn't I be able to reference and change the properties of one form from
another form?  Example:

Form1 is a customer lookup window

Form2 is a customer data screen

Shouldn't I be able excecute a command like this from form2:

    form1.caption="Don't let the door hit you on the way out"

I've been able to do this with several other forms but I keep getting an
error to the effect of "FORM1 is not an object."   Is this a bug?  Is there
some funky behind the scenes naming convention going on?

Thanks,

Keith



Fri, 01 Mar 2002 03:00:00 GMT  
 Cant Reference other Forms Properties

Quote:

>Shouldn't I be able to reference and change the properties of one form from
>another form?  Example:

>Form1 is a customer lookup window

>Form2 is a customer data screen

>Shouldn't I be able excecute a command like this from form2:

>    form1.caption="Don't let the door hit you on the way out"

>I've been able to do this with several other forms but I keep getting an
>error to the effect of "FORM1 is not an object."   Is this a bug?  Is there
>some funky behind the scenes naming convention going on?

     "Form1" is the name of the form.  It is not an object reference.
You need an object reference.  Pass this to form2 so it can do this.
e.g.
          refone=createobject("form1")
          reftwo=createobject("form2",refone)
and pick up the parm in form2's .init():
          procedure init
          lparameters potherform
             this.otherform=potherform  && Be sure to def the property
and then you use
          this.otherform.caption="Don't let..."

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
     I have preferences.
     You have biases.
     He/She has prejudices.



Fri, 01 Mar 2002 03:00:00 GMT  
 Cant Reference other Forms Properties
You do it like this from form 1:

local m.oForm1
m.oForm1 = thisform
do form2 with m.oForm1

**********************************
in the init method of form2..........

parameters m.oForm1
oForm1.caption = "this is a test"
oForm1.width = 50
*
*  and so on...
*

Quote:
>Subject: Cant Reference other Forms Properties

>Date: Mon, 13 September 1999 04:38 PM EDT

>Shouldn't I be able to reference and change the properties of one form from
>another form?  Example:

>Form1 is a customer lookup window

>Form2 is a customer data screen

>Shouldn't I be able excecute a command like this from form2:

>    form1.caption="Don't let the door hit you on the way out"

Mike


Sat, 02 Mar 2002 03:00:00 GMT  
 Cant Reference other Forms Properties
You may reference other forms via the _SCREEN.Forms
array.  If you know which form you want to get at, just
scan the _SCREEN.Forms array for the desired form.  Then
when you've found it, do with it what you will.

You may also use the method described by Anders - passing
a form1 object reference to form2.

-- TRW

Quote:

> Shouldn't I be able to reference and change the properties of one form from
> another form?  Example:

> Form1 is a customer lookup window

> Form2 is a customer data screen

> Shouldn't I be able excecute a command like this from form2:

>     form1.caption="Don't let the door hit you on the way out"

> I've been able to do this with several other forms but I keep getting an
> error to the effect of "FORM1 is not an object."   Is this a bug?  Is there
> some funky behind the scenes naming convention going on?

> Thanks,

> Keith

--

--------------------------------------
Remove the "drop this" strings from my
e-mail address to reply.
--------------------------------------



Sat, 02 Mar 2002 03:00:00 GMT  
 Cant Reference other Forms Properties
Tries to launch your with with the following syntex :

    DO FORM form1 NAME form1 LINKED

this will make the form an referable object.

Charles.


Quote:
>Shouldn't I be able to reference and change the properties of one form from
>another form?  Example:

>Form1 is a customer lookup window

>Form2 is a customer data screen

>Shouldn't I be able excecute a command like this from form2:

>    form1.caption="Don't let the door hit you on the way out"

>I've been able to do this with several other forms but I keep getting an
>error to the effect of "FORM1 is not an object."   Is this a bug?  Is there
>some funky behind the scenes naming convention going on?

>Thanks,

>Keith



Sun, 03 Mar 2002 03:00:00 GMT  
 Cant Reference other Forms Properties
_screen.forms(2).caption="Don't let the door hit you on the way out"
-Anders


| Shouldn't I be able to reference and change the properties of one form
from
| another form?  Example:
|
| Form1 is a customer lookup window
|
| Form2 is a customer data screen
|
| Shouldn't I be able excecute a command like this from form2:
|
|     form1.caption="Don't let the door hit you on the way out"
|
| I've been able to do this with several other forms but I keep getting an
| error to the effect of "FORM1 is not an object."   Is this a bug?  Is
there
| some funky behind the scenes naming convention going on?
|
| Thanks,
|
| Keith
|
|
|
|



Tue, 12 Mar 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

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

2. Form array properties: passing by reference

3. reference form property in a function

4. Referencing form properties

5. referencing properties in a non-active form

6. problem using EVAL() with form property referencing

7. Referencing properties on non-active form

8. Referencing properties from another form

9. ?? Pass property by reference

10. Expert help requested -passing class properties to UDFs by reference

11. Help with ActiveX control property references

12. Expert help requested -passing class properties to UDFs by reference

 

 
Powered by phpBB® Forum Software