MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Dave can you have another look at my generating controls on userform post

Posted by steve w on May 09, 2001 4:58 PM

Heres the address


What I needed was to generate textboxes and refedits based on a textbox value from page1.

Thanks dave

steve w

Posted by Dave Hawley on May 10, 2001 5:49 AM

Hi Steve

here is an example of how to create an msoObject placed on a UserForm: In this case a TextBox

Private Sub CommandButton1_Click()
Dim tTextBox As MSForms.TextBox
Set tTextBox = Me.Controls.Add("Forms.TextBox.1", "TextBox1", True)
With tTextBox
.Left = 2
.Name = "TextBox1"
.Left = 10
.Top = 10
.Height = 20
.Width = 60
End With
End Sub

...But if you are creating a Wizard you are going about it the hard way. All you need to do is have all Controls and Code on your UserForm and MultiPage and use the Visible property on each control to show or hide.


OzGrid Business Applications