>>>What is the best way to close a form in INIT of form if a condition does not exist. My concerns are making sure that everything is released properly. My siuation is that I have a third party active-x control, in the init of the form I need to run a method of active-x and if returns .f. not allow form to open. I want to make sure nothing is left dangling !
>>
>>Try RETURN .F. from the init method.
>
>Thanks for reply however, I think any object other than a form, returning .f. in init would be fine. I think though that objects contained on form would not be released or they would be left dangling by just returning .f. in INIT of form. I guess I can release or destroy the form. I'll just have to research further.
Working with Active-X it's often safer to start/kill them from Form.Activate event. Create some form property-flag 'firstacivateflag', set it to .T. in Form.Init event, and in Form.Activate:
If This.Firstactivateflag=.t.
This.Firstactivateflag=.f.
Endif
Edward Pikman
Independent Consultant