>I ran into a similar problem and got over it by calling the form with a name then accessing the name.
>
>Ex. DO FORM test NAME X
>You can then get to the form object or anythng it contains by referencing X.
>? x.name
>x.caption = "This is a test"
>x.txtName.Value = "Ken"
>
>I usually name all of my forms the actual name of the form. I cuts down on confusion. This also works for referencing one forms objects from another form.
As Jim said, your code may blow up, if e.g. you use it within menu procedure. However, it's not necessary to use Activeform, and sometimes it's not applicable (maybe you want to call form which is not active currently). The 100% solution can be accomplished by 2 ways:
1. Link form to external object property
Do Form Myform Name oApp.myform LINKED
or
2. Search through _SCREEN.Forms collection to get correct reference.
Edward Pikman
Independent Consultant