MLH <CR**@NorthState.net> wrote in
news:al********************************@4ax.com:
Consider the following class module...
Option Compare Database
Option Explicit
Private Sub Command0_Click()
MsgBox "One"
Call MySub
MsgBox "Three"
End Sub
-------------------------------------------------------------
Private Sub MySub()
MsgBox ("Two")
End Sub
When the Call MySub line is executed in Sub Command0_Click,
are remaining lines to be processed in the first Sub completely
suspended until processing in Sub MySub is completed. Is there
EVER any possibility of any lines in the first sub being
processed until Sub MySub is completely finished or terminated earlier by
error?
To make the question perfectly clear - is there any possibility
that lines from both subs could EVER be processing in 2
concurrent threads?
Well, that depends entirely on what you're calling code does.
If it's asynchronous, it will return control back to the original
context and continue executing the next line. If it's not, it
won't.
There's no way to say for sure without knowing exactly what code
you're calling.
If, for instance, your called MySub() makes a call to Shell() it
will return control back to the calling sub before Shell() has
finished, since Shell() always executes asynchronously (it you want
to avoid that with Shell(), look up ShellAndWait() on the Access
web).
Another example: DoCmd.OpenForm executes asynchronously when you
don't use the acDialog argument.
THe answer to your question is entirely dependent on what your code
does.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc