I agree with Sylvain that it's better to call a method of the parent. Even this is not really good OOP design since child form should know about its parent. We did, however, use this a lot in our application.
>You have to save the reference in a propriety of the form, otherwise the variable will go out of scope at the end of the Init event.
PARAMETERS oform, mcallnum
>THISFORM.oForm = m.oForm
You then use THISFORM.oForm when you need to reference the parent form.
>
>BTW, referencing a parent form control from another form (specially when it's deeply localised like you case) is rarely a good idea. The day you will rename or move a control in the path, you will break the code and you it may take a while to locate and change all the references. It's far better IMHO to call a method in the parent form that will do the job for the child. For exemple:
>THISFORM.oForm.ShowIt()
>
>*-- In the parent ShowIt method
>*-- Tell the control to show itself
HTH
>
>>I have an application where a user clicks on a button and it opens another form, i call the form like this
>>
>>DO FORM nw_insure WITH thisform, mcallnumber
>>
>>on closing the form nw_insure i have to make a field visible on the parent form depending on certain criteria. I wanted to use
>>
>>oform.pgfpageframe1.page3.txt_enterinitials.Visible = .T.
>>
>>but this does not work. On the init of the nw_insure I have
>>
>>PARAMETERS oform, mcallnum
>>
>>so i thought that the oform.... would work. any ideas?
If it's not broken, fix it until it is.
My Blog