0
votes

I have a sheet that has a ListBox. The sheet code has a ListBox_DblClick sub that launches UserForm1. UserForm1.CommandButton1 launches UserForm2. The user may input data in UserForm2 then press UserForm2.CommandButton1 which launches a sub in a module (yet to be written) and closes UserForm2.

With the code below, both UserForm2 and UserForm1 close. I just want UserForm2 to close upon click of UserForm2.CommandButton1.

Any thoughts on what I'm doing wrong are appreciated.

UserForm2 code

Private Sub CommandButton1_Click()

    Call UpdateBids(TextBox1.Object.Value, TextBox2.Object.Value, ComboBox1.Object.Value)
    Unload Me

End Sub
1
What is your full code - even better can you post your workbook? - brettdj

1 Answers

0
votes

Upon researching this again, I stumbled upon this post: Why, after launching a userform from a userform, does unloading the 2nd userform close both?

In short it suggested closing Excel then adding DoEvents following UserForm2.Show. It worked. Now only my UserForm2 closes. I've not had the problem since.