>Thank you for your answer.
>Unfortunately the form was in a class that i didn't want to change.
>Therefore in the Init event of form1 i created a public variable object with the name of form1, which is similar to the solution you gave me.
>
>Once again thank you for your help,
>
>Spyros Christodoulou
Since you are calling this from a form, you could use this code to get a reference to the parent form object
IF NOT EMPTY(WONTOP())
cWindow = WONTOP()
FOR nForms = 1 TO _Screen.FormCount
IF _Screen.Forms(nForms).Name = cWindow
This.oForm = _Screen.Forms(nForms)
ENDIF
ENDFOR
ENDIF
HTH,
Tracy
Tracy