
Exit Sub from called Function
I think you'd need to do one of two things: either (1) set the return
value of the function to a special value that will be interpreted by
the calling code as a cancel request, or pass an extra argument
variable to the function that the function will set to a value
indicating a cancel request. Note that this argument must be passed
ByRef, but that should be no problem since that's the default.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Quote:
> Exit Sub from called Function
> Lets say Im in a Sub of an OnClick event and I call a
> function to do some calculations. Based on those
> calculations I may or may not want to exit the Sub. How
> would I bring back a variable or string from that function
> to use in an If Then statement so I can exit that OnClick
> event without running some code?
> Is this possible or am I going about this the wrong way?
> Thanks
> Russell