>Hi,
>
> This is my last question for this topic.
>
> Could you please tell me the exact code for:
>
>
> 1. I check for a form if they already active.
> 2. if the form is not active I use do form "myform"
> 3. if its already active I want to activate it instead of do form "myform"
>
>Thanks
Larry,
No one could give the "exact code" for that because there is no one way of doing it. I saw you came to a point with David, what he suggested is one of the ways (a good way). Now I rewind the situation and try to explain. First something to beware with .name approach :
A .name is not unique for _screen.forms (You can have multiple forms where name is "Form1"). To overcome it you could give them unique names and with this way David's code does what you want. Another way with or w/o a menu or toolbar, is to launch forms with names : do form myForm name myEntryForm linked. With this approach you could check if exists w/o looping forms collection. And another one (I think this one is complex for now) is to use application object and keep an array there.
OK now a simple approach and code to launch your form, check existence and activate if alive :
if type("frmPosition") = "O" ;
and !isnull(frmPosition) ;
and frmPosition.baseclass = "Form"
frmPosition.show()
else
do form myForm name "frmPosition" linked
endif
Cetin