>Exactly! and it does work without a hitch in debug, but not otherwise. I am running the code in a VFP window, mind, but still ...
Hard to say then. But I definetely would not name the window Error (would at least name it wndError) and I would use SELECT 0 as Borislav suggested.
But anyway, from the first glance this code should work as is, unless there is an error somewhere eaten by the error handler.
If it's not broken, fix it until it is.
My Blog