G
Guest
Hi, I've created a number of textboxes using the following code.
For Count = 1 to 30
Set MyTBox = MyControl.Controls.Add("Forms.textbox.1")
With MyTBox
.Width = 150
.Height = 20
.Top = 20 * Count - 13
.Left = 2
.name = "TBox" & Count
.Visible = True
End With
Next
I now want to access say the fifth box (TBox5)
I have a string (BoxName) with the name of the box TBox5 or I could use an
integer variable to indicate that I want the fifth box, but how do I refer to
this box? I tried:
MyTBox.BoxName.value = ... but this does not work,
and I tried:
MyTBox(5).value = ... this too does not work. What am I missing?
Again, thanks for your help in advance!!!
For Count = 1 to 30
Set MyTBox = MyControl.Controls.Add("Forms.textbox.1")
With MyTBox
.Width = 150
.Height = 20
.Top = 20 * Count - 13
.Left = 2
.name = "TBox" & Count
.Visible = True
End With
Next
I now want to access say the fifth box (TBox5)
I have a string (BoxName) with the name of the box TBox5 or I could use an
integer variable to indicate that I want the fifth box, but how do I refer to
this box? I tried:
MyTBox.BoxName.value = ... but this does not work,
and I tried:
MyTBox(5).value = ... this too does not work. What am I missing?
Again, thanks for your help in advance!!!