Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error zero

Status
Not open for further replies.

huBBLe

Programmer
May 15, 2001
50
SG
this question may sound silly but i really have no idea wat it means.

i keep getting this "error 0" error when i use Err.Number in my error handler. when i do a Err.Description, it doesn't print anything.

my questions are:
1) What is this error 0?
2) Does it mean there is no error? (but if there is no error, why is it raised?)

thank you
 
That means there is no error. One thing to check in your procedure, is that your error handler is not part of the body of your code. See below:

Public Sub MySub()
On error goto MYERROR 'your error handler label
'
' code
'
Exit Sub 'make sure if there is no error that
'your error handler does not get executed
MYERROR:
'raise errors here
End Sub
 
works buddy! thanks.

think this has something to do with the code falling through all the error handlers rite?
 
Exactly right.

I've been doing this stuff for years, and there are still times that I forget to exit the routine before the error handling section.

The big problem is that no released version of VB to date has actually had good error/exception handling available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top