On second thought, you may be better off checking for the existance of the form before launching it. You could use something like this:
llMyFormIsOpen = .f.
for each oForm in _VFP.Forms
if oForm.Name = 'MyForm'
llMyFormIsOpen = .t.
endif
next
if llMyFormIsOpen
wait window 'form is already open' nowait
else
DO FORM MyForm
endif
>Hi Ken,
>
>Here goes! I have a loop that calls a form (like thus):
>
>glDone = .f.
>DO WHILE !glDone
> DO FORM MainForm
> READ EVENTS
>ENDDO
>
>When exiting the form, the program prints some reports and returns to run the form again so that all the initalization, etc. will run. The problem is that on some slower machines if the user presses the
key to run the reports and then continues to press the key....the program tries to run the form again before the old instance is released. So I thought if I could disable the keyboard till it was "all clear" to do the form again, that would be a good thing. Many thanks for asking.
>
>
>>Hi Ronald,
>>
>>You can do this easily enough with individual forms, or are you talking about completely disabling it at the OS level? What is it you're trying to do?
>>
>>>Does anybody know of a way to disable the keyboard for a set amount of time. Any help is appreciated.
kenweber
GCom2 Solutions
Microsoft Certified Professional