GoTo from a form button to a macro
"Spike" wrote:
I have a macro that calls a Form on an error. This form gives the user the
choice of Continueing or Exiting. If the Continue button is selected how do
i get the focus (after unloading the form) to return to a particular part of
the macro; as one would with a GoTo command in a macro. i want to return to
the calling macro but at a different place from where the form is called.
Any advices will be gratefully received.
Hi Spike,
The cleanest way to do this would be to have a seperate Sub for the macro at
the new entry point. For example, if you wanted to skip a chunk of code, you
would work along the lines below:
Old code:
DoSomeStuff
If error then displaycontinueform
DoSomeOtherStuff
DoEvenMoreStuff
New code:
Do some stuff
If error then displaycontinueform
If UserClicksContinue then RunFromThisPoint
DoSomeOtherStuff
RunFromThisPoint
Sub RunFromThisPoint
DoEvenMoreStuff
End Sub
I hope this helps
--
TimB
|