Unknown error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a standard "error trap" in a form..

On Error goto ...

lable
mesbox
call exit lable

label
exit

however i keep getting a "blank" error then an error that says to resume w/o
error.

any ideas?
 
You need to put Exit Sub (or Exit Function if you're dealing with a
function) before the code for your error handler:

On Error GoTo Err_Routine

' code

End_Routine:
Exit sub

Err_Routine:
' code
Resume End_Routine

Note the use of Resume in the error handler. That ensures that the error is
cleared from the stack. Any cleanup that's required whether or not the
routine is successful would go into the End_Routine block before the Exit
Sub line.
 
thanks for the info. i'll try that after lunch.

why does the the exit have to go before the error?
 
I have a standard "error trap" in a form..

On Error goto ...

lable
mesbox
call exit lable

label
exit

however i keep getting a "blank" error then an error that says to resume w/o
error.

any ideas?

Please post your actual code and the actual error message. There is nothing in
Access called "mesbox", "call exit lable" is meaningless, and the error
certainly doesn't say that.

John W. Vinson [MVP]
 
If you don't put the Exit, code execution will continue into the error
handler.

Access has no way of knowing that you only want to run the error handler
code when there's an error.
 
Back
Top