Hello
Any idea In Class1 KeyPress_Event How do i get the name of textbox whose name property has been changed to "txtbx" & i when loaded on Userform1 at run time.
Able to load the form with 25 textboxes but dont know how to get the name of textbox in keypress event of Class Module. After getting the name i want that textbox to KeyAscii = 0
[Code]
Private Sub UserForm_Initialize()
Dim i As Integer
Dim newTextbox As MSForms.TextBox
Dim x As Integer
Dim y As Integer
x = 20
y = 20
For i = 1 To 25
Set newTextbox = Controls.Add("forms.textbox.1")
With newTextbox
.Name = "txtbx" & i
.Top = y + 20
.Height = 18
.Left = x
.Width = 150
.Font.Size = "10"
.Font.Name = "Calibri"
End With
y = y + 20
Next i
End Sub
[Code]
Regards
Sam