Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent user to open form second time
Message
From
26/01/2005 10:38:35
 
 
To
26/01/2005 10:18:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Novell 4.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00980766
Message ID:
00980782
Views:
48
Hi, Saif.

>Is there any way to prevent users to open an already open form twice.
>I made command button disable after open a form. But when the form release this command button does not enable.

You can check in the form's Init whether there is another instance of the same form open, like:
llAlreadyExists = .f.
for each loForm in _Screen.Forms
   if loForm.Caption = this.Caption
      llAlreadyExists = .t.
      exit
   endif
next

return NOT llAlreadyExists
Notice that I'm using the Form's caption to check for the equivalence, but you can use some other property where we have some unique identification if you need it.

Hope this helps,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform