Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One instance works with VFP7 ! vfp6
Message
From
26/05/2004 12:13:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/05/2004 12:01:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00907127
Message ID:
00907412
Views:
11
>Thanks but that does not work either. Maybe it's best to add more information.
>
>I'm working with AccountMate LAN 505. From the menu I open a formset and make the main form active. But I want only one instance of the formset to be active (single instance). So in the init of the formset I look for another main form. But your code and my code closes it's self even it's the first form. I'll try the load of the formset.
>TIA
>John

John,
I never worked with formsets but basically they're forms too. Initialize your formset with a name clause and check if exists and !isnull.
ie:
if type('oApp.frmBrds')='O' and !isnull(oApp.frmBrds)
oApp.frmBrds.Show()
else
do form myFormSet name oApp.frmBrdms
endif

Or as you do with _screen.forms looping :
local ix,loForm,llExists
for ix=1 to _screen.forms.count
 loForm = _screen.Forms(m.ix)
 if upper(loForm.Name) == "BRDMS"
    loForm.Show
    llExists = .t.
    exit
 endif
endfor
if !llExists
 do form BRDMS
endif
PS: If you're doing the check in the init then it'd count itself too. In that case return .f. from init.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform