Exit a Sub/Function Access 2002

V

Van T. Dinh

See comments in-line.

HTH
Van T. Dinh
MVP (Access)


-----Original Message-----
Hello All,

I have a sub routine that calls a function. When certain
conditions are met in the function, I've used an exit
function command to exist the function.

However, the program resumes on the next line of the sub
routine that called the function.

How can I exit the function and also exit the sub routine
on the line following the call of the function.
I think you need to return a value that indicated that the
function was exited (abnormally) and then checked for this
value in the calling Sub. If this value is returned, you
can exit the Sub.


Also, how can I determine what sub routine called a
function within the function itself.
Nothing in-built AFAIK. However, you can pass the calling
Sub name as an argument of the custom function and use the
value of the argument in the function to get the calling
Sub name.
 

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

Top