>>>>Hi,
>>>>
>>>>I have a problem, which is when i have a form open i can click on to the 'X' button of the form in the top right hand corner. the problem is when the form closes the valid event of the textbox i am on is run. is there any way i can stop the valid and lostfocus events from running when the 'X' button is clicked or even when a command button is clicked?
>>>>
>>>
>>>Why?
>>>
>>>If you need to do this, I suspect you are using the valid event wrong.
>>
>>Hi Eric,
>>
>>I was just wondering why you felt it was being used wrong. I was doing some research on the valid (and other ways to validate user input) yesterday so if you have a spare minute.
>>
>>You could use,
>>
IF THISFORM.RELEASETYPE = 1
>>** don't validate (user clicked X, doublclicked form icon, etc..)
>> RETURN .T.
>>ELSE
>>** Do the validation
>>return .F.
>>ENDIF
>>
>
>This will work fine. I sort of realized halfway through my post why someone would want it to be ignored when the form was closed via the "x". I don't generally validate input this way, so the need never arose for me.
Ok, I wrote up a wiki topic about it. Just wondering if there was anything I could add to it. :)
Roi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!