missing object

In our program, we call form "BB" from "AA" and can refer back to object "AA" from "BB" with no problems.  Now from form "ZZ" call "AA" then from "AA" call "BB", now "BB" cannot refer back to "AA".  Instead, we get "cannot find object 'AA'", even though "AA" is still open on the screen.

Thanks in advance.


Answer this question

missing object

  • Shadowsoul

    I am not sure how you are referring to each of the forms in question, but I will guess you are using the form name which VFP can use in a public memvar. I would not recommend relying on this behavior if you are doing this.

    What I recommend is passing a reference of the current form to the form you are running.

    DO FORM bb NAME bb LINKED WITH thisform

    In the Init() of the form being run save off the reference to the calling form to a property of the form.

    LPARAMETERS toCallingForm

    this.oCalliingForm = toCallingForm

    Now you have a reference to the calling form and can reliably use the reference as you have been previously. Make sure to NULL out the object property in the form Destroy() so there are no hanging references to the calling form.

    Hope this helps. 

  • missing object