Exiting/Calling procedure

  • Thread starter Thread starter rob nobel
  • Start date Start date
R

rob nobel

I have the following procedure that calls Balance1(UserForm)....
Sub BalanceFirst()
Balance1.Show
Call First
End Sub

If the cancel button is selected on the Balance1....
Private Sub CancelButton_Click()
Unload Me
End Sub
.....then,
I would like it to stop the whole procedure at this point and not carry on
with the next line in the procedure that called it, namely the line Call
First.
.....But,
if the OK button is selected, I would like it to do Call First and then
jump back and do the rest of the code in the OKButton_Click procedure.
Can this be accomplished?

Rob
 
rob nobel said:
I have the following procedure that calls Balance1(UserForm)....
Sub BalanceFirst()
Balance1.Show
Call First
End Sub

If the cancel button is selected on the Balance1....
Private Sub CancelButton_Click()
Unload Me
End Sub
....then,
I would like it to stop the whole procedure at this point and not
carry on with the next line in the procedure that called it, namely
the line Call First.
....But, if the OK button is selected, I would like it to do Call First
and then jump back and do the rest of the code in the OKButton_Click
procedure. Can this be accomplished?

If you set a global status variable in the CancelButton_Click handler for
Balance1, then you can check it when control returns to BalanceFirst.
 
Good suggestion. Thanks Harlan.
Rob

Harlan Grove said:
If you set a global status variable in the CancelButton_Click handler for
Balance1, then you can check it when control returns to BalanceFirst.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top