My directive is to use a button called "Legend" on a userform called "PlatformData" to open another userform called "PlatformLegend". Both userforms are for viewing existing data only, I don't wish to hide the first userform, and as far as I am aware, it doesn't matter if is it modeless or modal because I don't need to perform any actions while either userform is being viewed other than the ability to unload them. My issue is that I am able to get the second userform opened and viewed, however, none of the initialization code is executing (not even a simple MsgBox function), and is showing just the bare userform (all of my controls are dynamically added with VBA code). What am I doing wrong here?
Here is the relevant code for the first userform called "PlatformData" that has the "Legend" button to be used to view the second userform:
Here is the relevant code for the second userform called "PlatformLegend":
Any feedback would be greatly appreciated, and thank you in advance.
Here is the relevant code for the first userform called "PlatformData" that has the "Legend" button to be used to view the second userform:
Code:
Private Sub CommandButton1_Click()
' OK button to unload PlatformData userform
Unload Me
Exit Sub
End Sub
Private Sub CommandButton2_Click()
' Legend button to show PlatformLegend
Worksheets("Home").Activate
PlatformLegend.Show
End Sub
Private Sub Userform_Initialize()
MsgBox "Blah blah blah blah this is my first userform blah blah blah"
End Sub
Here is the relevant code for the second userform called "PlatformLegend":
Code:
Sub Userform2_Initialize()
MsgBox "Show me my controls!"
Dim ccControl As Control
Set ccControl = Me.Controls.Add("Forms.Label.1", "LegendTest", True)
With ccControl
.Caption = "Hello"
.Top = 42
.Left = 12
End With
End Sub
Any feedback would be greatly appreciated, and thank you in advance.