>>>How can I prevent a user from clicking on another form unless they have completed a specific task [under 1 specific condition] on the currently active form. I can not make the currently active form modal because most of the time [90%], the user can jump to other forms.
>>>
>>>I have tried stuff in the deactivate and lostfocus, but nothing works very cleanly.
>>>
>>>TIA!
>>
>>Hi Mark,
>>
>>How about making the form Modal?
>
>Nope. Can't do that. Re-read my entire problem. Actually I have found a clever solution. When the condition exists where I have to
simulate a modal form, I change the form's AlwaysOnTop property to true. The problem was the Deactivate was firing twice -- once when the user clicks on another form and once because of the messagebox. In the Deactivate, I put:
>if This.lAddMode
> if empty(This.Tag)
> This.Tag = "NOMSG"
> MessageBox('You must first complete or cancel the addition of the new record.', MB_ICONEXCLAMATION, "Warning...")
> This.Show()
> else
> This.Show()
> This.Tag = ""
> endif
>else
> DoDefault()
>endif
>This is kind of a kludge, so I am open for more elegant options.
I meant that you can make form Modal on the fly conditionally
IF thisform.lAddMode
thisform.Hide()
thisform.Show(1)
endif
this works , but I am testing this now and having troubles with returning to modeless state.
thisform.Hide()
thisform.Show(2)
Hmmm...
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison