Is it possible to "build" a control name reference using code. For Example,
I have a form with 80 text boxes on it. They are named txtType1, txtType2, txtType3 ,
....., txtType80.
I want to construct a loop to process the various properties of the text boxes. I have tried various things to no avail. I am thinking something like the following:
Private Sub cmdUpdate_Click()
Dim counter As Integer
Dim varType As Stringl
counter = 1
While counter < 81
varType = "txtType" & counter
Me.Controls(varType).text = (Something)
(Set other properties here)
counter = counter + 1
Wend
End Sub
This is not working but it gives a sense of the logic I am trying to use. Any help would be appreciated.
MattB
I have a form with 80 text boxes on it. They are named txtType1, txtType2, txtType3 ,
....., txtType80.
I want to construct a loop to process the various properties of the text boxes. I have tried various things to no avail. I am thinking something like the following:
Private Sub cmdUpdate_Click()
Dim counter As Integer
Dim varType As Stringl
counter = 1
While counter < 81
varType = "txtType" & counter
Me.Controls(varType).text = (Something)
(Set other properties here)
counter = counter + 1
Wend
End Sub
This is not working but it gives a sense of the logic I am trying to use. Any help would be appreciated.
MattB