Access2003 Runtime Error

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

Guest

What can I replace END with in VBA - when using END in runtime - I receive an
error message - however Exit Sub and Exit function are of no value at times -
if the function is called from another procedure then the program will exit
from the first but continues on from the procedure which it was called from.
I need to stop the program at a particular point (mainly to display a
message) without it continuing on. The error only occurs when using /runtime
option
 
Generally speaking you need to trap that condition. Then you can act
accordingly with your MsgBox and or Exit Sub if that is what's required.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| What can I replace END with in VBA - when using END in runtime - I receive
an
| error message - however Exit Sub and Exit function are of no value at
times -
| if the function is called from another procedure then the program will
exit
| from the first but continues on from the procedure which it was called
from.
| I need to stop the program at a particular point (mainly to display a
| message) without it continuing on. The error only occurs when using
/runtime
| option
 
Dave said:
Generally speaking you need to trap that condition. Then you can act
accordingly with your MsgBox and or Exit Sub if that is what's
required.

You can also have the called sub or function re-raise another error that is
propogated back to the calling code so that you can then interupt (and end) that
code as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top