>>Hello all,
>>
>> How do I tell a form which commandbutton on another form called it?
>>
>>Thanks
>
>Not related to MM framework in any way, but here is a little trick:
>
>When the called form initializes, the _screen.ActiveForm still points to the calling form.
>
>So, in the FORM2.Init()
>
>
>oCallingForm =_screen.ActiveForm
>oCallingControl = _screen.ActiveForm.ActiveControl
>
>
>This allows to avod passing any parameters. You can save the object references to the Form2 properties if you want. And I would prefer to save the hierarchy names (SYS(1272)) instead, to avoid the dangling object references. You can always get the object reference again with EVALUATE() function when necessary.
Great tip Nick. We may be splitting hairs in this case but when I'm working with MM I pass a parameter because I don't call the second form from the button click method. Kevin has drilled it into my head to put code on the business object, not the form. I'll have to do some testing to see if the button would still be the ActiveControl.
Bob Kocher
www.swfox.netStart making your plans now to attend Southwest Fox 2006