Sub Form versus Main Form.

Hi all, Is there a way to check on a subform where the subform is being called from? I have 2 main forms and each main form is using the same subform. Roelof.

Roelof, You can always create a function on the subform to set a global variable. Run this function from the onOpen trigger of the main forms. Something like: CurrForm.SalesLines.FORM.SetGlobal(‘Form Name’) You can then refer to that variable within the subform. Chris Krantz NCSD,NCSQL,MCSD,MCSE Microforum Inc. Toronto, Ontario, Canada

There is no implemented reference such as a CurrForm.ParentForm property. You don’t have a chance to call a function or fire a trigger on the parent form from your subform. ------- With best regards from Switzerland Marcus Fabian

In parent form 1: OnOpenForm() CurrForm.SalesLine.FORM.CAPTION(‘FORM A’); In parent form 2: OnOpenForm() CurrForm.SalesLine.FORM.CAPTION(‘FORM B’); In the subform: CASE CurrForm.CAPTION OF ‘FORM A’: BEGIN // your code here END; ‘FORM B’: BEGIN // your code here END; END; Regards, Floyd Chan FutureLink Canada Corp.