>Any great idea how would i prevent to open a form more than once...
I have an application object, goApp, that has a DoForm method. In my apps I almost always start a form with goApp.DoForm('myform', 'formname')
The MYFORM is the actual .SCX file name of the form. The FORMNAME is the value of the NAME property of the form. If I pass the FORMNAME parameter, my DOFORM method just activates the form if it exists. If the form is not already instanciated, I just issue a DO FORM (MYFORM)
If I do NOT pass the second parameter, then I open multiple instances of the form. I loop through the forms collection to see if FORMNAME exists.
lparameter tcForm, tcFormName
local llFound, i
llFound = .f.
i = 0
if !empty(tcFormName)
for i = 1 to _screen.formcount
if upper(_screen.forms(i).name) = tcFormName
llFound = .t.
exit
endif
endfor
endif
if llFound
_screen.forms(i).Show()
else
do form (tcForm)
endif
Mark McCasland
Midlothian, TX USA