
referencing properties in a non-active form
If the active form doesn't have an existing object reference for the second
form, you can cycle through the forms collection of the _SCREEN object. See
the FORMS property in the on line help for _SCREEN...
Here's an example...
FOR x = 1 TO _SCREEN.FormCount
IF _SCREEN.Forms(x).NAME = "Whatever Form Name You're Looking For"
_SCREEN.Forms(x).SomeProperty = Something different
EXIT
ENDIF
ENDFOR
You could also stuff the object reference of the second form in a property
of the first one if you want to refer to it later.
FOR x = 1 TO _SCREEN.FormCount
IF _SCREEN.Forms(x).NAME = "Whatever Form Name You're Looking For"
THISFORM.r_ObjectProperty = _SCREEN.Forms(x)
EXIT
ENDIF
ENDFOR
Then you could refer to it later this way...
THISFORM.r_ObjectProperty.SomeProperty = Something Different
Just remember to release the object reference before you try to close
either of the forms, otherwise you will have outstanding object references.
THISFORM.r_ObjectProperty = .F.
--
William Fields
US Bankruptcy Court
Phoenix, AZ
Quote:
> Excuse the terminally dull subject title, but I couldn't think of a
better way
> to summarise my question. I have two forms open. One has a push button
which,
> when clicked passes a value to a property of the second form. At least
that's
> what I would like it to do. I am having trouble figuring out what syntax
I need
> to refer to the property in the second form. If I use (formname.property)
then
> I of course get a message saying that 'formname' doesn't exist. I know
this is
> probably a ridiculously simple problem, but I am suffering from a mental
block
> at the moment and would appreciate any assistance.
> Thank you, thank you and thrice thank you.
> - Alex