>>You could put your code in Form.Activate event triggering it to ensure that it will fire one >time only:
>>Init event:
>
>>This.FirstActivateFlag=.T. && custom property
>
>Hi Edward
>I prefer to do that in the init() method, that way it only fires once, and in the init() method of the form the commnadbutton is already active and you can execute it's click()) method
>
>In the form's init()
>
>thisform.cmdMyCommandButton.Click()
>
>and it works.
>It can be done in the activate method of the form of course, but you need a flag in order to know that it won't be executed twice
>Regards
>Hernan
Actually, I explained in my message how it's going to be fired once form Activate. Please, read it again in entirety. There are situations when firing in Init is premature.
Edward Pikman
Independent Consultant