>LOCAL x,nformcount
>nformcount=0
>
>FOR x=1 TO _SCREEN.FORMCOUNT
> IF UPPER(_SCREEN.FORMS(x).NAME)=='BFRMSORD'
> nformcount=nformcount+1
> ENDIF
> IF nformcount>1
>
> THISFORMSET.bfrmsord.HIDE()
> =ammsg('E',"Sorry the form is already available")
> ACTIVATE WINDOW bfrmsord TOP
> RETURN .F.
> ENDIF
>NEXT
>
>I am trying to allow only one instance of a formset. I placed the above code in the init of the formset. It works perfectly in VFP 7 but not in VFP6. In VFP 6 I get two of everything of the formset. Does anybody understand why? And how is it done in VFP6?
>TIA
>John
Works perfectly in 7 ??? This code lets double of every form :
IF nformcount>1
Wouldn't it be :
IF nformcount>0
if wexist('BFRMSORD')
=ammsg('E',"Sorry the form is already available")
ACTIVATE WINDOW bfrmsord TOP
endif
Cetin