I'm trying to add the values in several textboxes by using a variable array that concatenates the string "Text" & the incremented value(i), adds the value and then loops through code until the final textbox is evaluated. My code looks like this:
Private Sub Combo33_Click()
Dim i As Integer
Dim CompCost As Integer
Dim TextID As String
i = 236
Do While i < 266
TextID = "[" & "Text" & i & "]"
CompCost = Me!TextID
i = i + 1
Loop
txtCompCost = CompCost
End Sub
During the first pass through the code, when it comes to the line,
CompCost = Me!TextID,
an error informs me that object "[Text236]" can't be found. , I think that this may be the problem because it's viewed as a string. Any Ideas?? Thanks.
Private Sub Combo33_Click()
Dim i As Integer
Dim CompCost As Integer
Dim TextID As String
i = 236
Do While i < 266
TextID = "[" & "Text" & i & "]"
CompCost = Me!TextID
i = i + 1
Loop
txtCompCost = CompCost
End Sub
During the first pass through the code, when it comes to the line,
CompCost = Me!TextID,
an error informs me that object "[Text236]" can't be found. , I think that this may be the problem because it's viewed as a string. Any Ideas?? Thanks.