Since no one seems to know this answer, I did come up with a solution - AERROR.
AERROR has the right error number.
I think the cause of the error() not changing is when another ON ERROR is called. Why, I don't know.
>I am trying to trap the error when opening a table and I have noticed in the debugger that the error() doesn't change if I get an error. I corrupted the index on a table and when I open it I should get a 114 error number. Instead it stays at 0 and my handler doesn't work.
>Any ideas?
>TIA!