Closing 1 form closes both open forms

jacko2401

New Member
Joined
Aug 24, 2011
Messages
35
Hi

I have 1 main userform and I need to open another userform using a command button from within that 1st form. The 2nd userform appear right in front of the 1st userform. When the 2nd userform is closed either via VBA or clicking on X, it closes both forms.

Does anyone know why this happens and how I can make only the 2nd form close when it is finished with?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
It would depend a lot on how the userform's are called or whether they are modeless.

One quick solution would be to .Hide the second userform rather than unloading it. (You can unload it in the first Userform's Terminate event.)
 
Upvote 0
It would depend a lot on how the userform's are called or whether they are modeless.

One quick solution would be to .Hide the second userform rather than unloading it. (You can unload it in the first Userform's Terminate event.)

The 2 forms are called RegPlayers and FrmNumber2

The first form is opened from a command button on a worksheet by assigning a sub procedure:
Sub Main_Players()
RegPlayers.Show
End Sub

The first form has a command button on it that has the following sub procedure that opens the 2nd form:

Private Sub CmdDOBCalendar_Click()
FrmNumber2.Show
End Sub

When you close the 2nd form, the first form also closes. Any ideas to stop this?
 
Upvote 0
I would put a break somewhere in FrmNumber2's code. and then step through its closing to see where RegPlayers is sending exicution after UF2 is closed.
 
Upvote 0

Forum statistics

Threads
1,215,584
Messages
6,125,666
Members
449,248
Latest member
wayneho98

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top