Steve
Normally I do but in this instance I am exiting the form anyway and am simply clearing the error back to default.
I have had a wee search through the 'error' documentation and it appears that you are right and that there is no way to by-pass error code in the control or its parent(s).
One would have to go to a more generic method, for which I will wait until I have VFP8 (three very long weeks) ho hum!!!
Geoff
>Geoff,
>
>If you want to temporarily override error behavior, you do it like this:
>
>
>lcError = on("error")
>on error llError = .t.
>on error &lcError
>
>* do processing
>if llError
> * an error occured
>else
> * no error
>endif
>
>
>Now, if you are in a form that has code in an error() method, I think the form's error() method will catch the error instead, so maybe this is the problem you are having.
>
>Doug Hennig has a good article on error handling on his website.
>
>Also, VFP8 has TRY/CATCH functionality which greatly improves the situation.
>
>
>>Hi
>>
>>I have event error code loaded in my form. As I am exiting I wish to reopen a table in exclusive mode to pack it.
>>
>>I have the following code
>>
>>
>>lHadErr=.F.
>>ON ERROR lHadErr=.T.
>>USE wDbc!myfile IN 0 ALIAS ml EXCLUSIVE
>>IF NOT lHadErr
>> SELECT ml
>> SET SAFETY OFF
>> PACK
>> SET SAFETY ON
>> USE
>>ENDIF
>>ON ERROR
>>
>>
>>which I assumed would override the code in the form.
>>
>>Unfortunately, it doesn't. Is it supposed to work this way???
>>
>>Why can I not temporarly suspend the default error routine and then reinstate it by clearing the error with
>>
ON ERROR
>>
>>Somewhat confused
>>Geoff Scott
May all your weeds be wildflowers