text()数组控件问题 求帮忙
form1上有text1(0)--text(4)5个数组控件,每个控件中有5组数,用循环求每个控件的和,即text(0)的和text(1)的和....text(5)的和,在text2中显示Private Sub Command3_Click()
Dim s() As String
Dim i As Integer, index As Integer
Text2.Text = ""
s = Split(Text1(i).Text)
Dim sum As Double
For i = 0 To UBound(s)
If IsNumeric(s(i)) Then sum = sum + (s(i))
For index = 0 To 4
index = index + 1
If Controls("Text1(" & index & ")").Text Then s = Split(Text1(i).Text)
sum = sum + (s(i))
Next
Next
Text2.Text = Text2.Text & sum & vbNewLine
End Sub
结果显示“未找到控件text1(1)”,求老师帮忙