Here's another VBA question for the Word 2003 macro experts.
Suppose I have a macro like this:
Sub MyWondrousInvention()
Userform_1_FRM.Show
Userform_2_FRM.Show
End Sub
As you can guess, the two items that "Show" are two user forms. The
first user form has a CANCEL button on it, and the code looks like this:
Private Sub ExitCMD_Click()
Userform_1_FRM.Hide
Unload Userform_1_FRM
End Sub
What I would like is that if the first user form exits because the
CANCEL button is pressed, the second user form does not and the
MyWondrousInvention sub is exited without the second step being
activated. But because the click routine is private, I can't figure out
how to make it abort the rest of the sub. I suppose some if-else-then
routine, but how does one do it in this case?
Regards,
Alan Stancliff
Wouldn't it make more sense to have
Sub MyWondrousInvention()
Userform_1_FRM.Show
End Sub
and
Private Sub ExitCMD_Click()
Unload Me
Userform_2_FRM.Show
End Sub
with additional sub routines called as required from each of the two user
forms?

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Here's another VBA question for the Word 2003 macro experts.
>
[quoted text clipped - 23 lines]
>
> Alan Stancliff
Alan Stancliff - 08 Mar 2008 20:10 GMT
Hi Graham,
Yup, it probably would make more sense. I'm going to play with it a bit
more tonight after work (I work weekends).
Thanks.
Regards,
Alan Stancliff
> Wouldn't it make more sense to have
>
[quoted text clipped - 11 lines]
> with additional sub routines called as required from each of the two user
> forms?
Alan Stancliff - 09 Mar 2008 08:40 GMT
I got it working now, Graham. It was much simpler than I thought. I
thought I would have to figure out some way of passing a value from a
private sub that was not even a function to a public one.
Regards,
Alan Stancliff
> Wouldn't it make more sense to have
>
[quoted text clipped - 11 lines]
> with additional sub routines called as required from each of the two user
> forms?