>I have posted several request with no answerers. So this is the last time I am posting this in a very simple situation. I know there are a lot of experts and hopefully someone will has an answer to this. Thanks again for broadening our minds and all the help that I get from here.
>
>The staff table has primary key for staffid.
>
>
>on error wait window str(error())+chr(13)+message()
>use staff
>browse
>
>Now when I change the staffid I get a general VPF error
>"Uniqueness of index STAFFID is violated"
>OK, Revert, Help
>
>
>I was expecting it to show me a wait window with:
>1884
>Uniqueness of index STAFFID is violated
>
>
>The error handler (ON ERROR) command does not seem to work ? Any suggestions.
>
>Note:
>If the code was:
>on error wait window str(error())+chr(13)+message()
>use staff
>replace staffid with 2 &&2 is already been used in the table
>
>This code does trigger the error handler.
Neeraj,
Could it be that there is an Error event method catching the error, or is the example you described typed directly into the VFP command window in a fresh VFP session?
Mike