I'm not sure what you're doing, but maybe you could create a public variable and
determine if the next userform should be shown based on what happened in the
first userform.
I put this in a General Module:
Option Explicit
Public OkToContinue As Boolean
Sub testme()
OkToContinue = False
UserForm1.Show
If OkToContinue = True Then
UserForm2.Show
End If
End Sub
I put this behind Userform1:
Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
OkToContinue = True
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.CommandButton1.Caption = "Cancel"
Me.CommandButton2.Caption = "Ok"
End Sub
===
So each userform is called from a general module--and the public variable
determines if the next userform should be called at all.
But if you're showing lots of userforms, have you thought of using one userform
with multipages? Kind of like what you see in the Tools|Options dialog.
Thanks for the info...
Basically I have coded a load of forms that inputs job start and
finish times into a sheet. Pretty simple concept and I have got it all
to work apart from this out of stack space error.
There are forms like Workers (with a list of name buttons), Start work
form (with work amount etc on it), finish work form with a big red
stop button on it! and a time lost form where users input time lost
for the job.
So the forms go like this..
Workers>Start Work>Workers>Finish Work>time lost>Workers and so on...
So at the end of each form (on commandbutton click) it says something
like
me.hide
*nextform*.show
end sub
It works fine but looks like each of these is staying in call stack
and eventually after a few hours of use it is causing an out of stack
space error. The only way to get around this error thus far has been
to exit "X" the forms and restart them (thus clearing the stack- I
assume)...
The MS supportsite said a way to get around this is to use show 0 or
show Vbmodeless (neither of which work with Excel 97).