>Hi Ed,
>
>Thanks for the very thorough explanation. Is this the only way to call a method from another form if the forms not part of a class? I could have sworn a couple of years ago I simply used something like _screen.forms. . . .yada yada.
yep - _Screen.Forms(
Item id).
MethodToInvoke is equivalent to the resolved oForm.
MethodToInvoke; _Screen.Forms(
Item id).
Control.MethodToInvoke == oForm.
Control.MethodToInvoke etc.
Look at it this way:
oForm = _Screen.Forms(
Item id)
oForm.MethodToInvoke()
You can assign an object reference at any level of the object hierarchy to a memvar.
Forms are always objects, regardless of how they're instantiated. All the FOR EACH does is iterate through the Forms collection without externally tracking the member's position. You can use a FOR...NEXT loop and iterate the item id, but as noted, invoking the Release method changes the member count and order, and gets all busted up when you iterate past the last member, and may skip members because of resequencing. And it's possible to have forms that are not a part of the _Screen.Forms collection...so you're best off looking into an application object that tracks form references to make retrieving their object refs easier.