I know the basics about adding numbers in text boxes. For instance:

Private Sub text4_KeyPress(keyascii As Integer)
keyascii = Asc(Chr(keyascii))
If Val(Text4.Text) = Val(Text1.Text) + Val(Text2.Text) And keyascii = vbKeyReturn Then
Text3.Visible = True
End If
End Sub


But the text box with the numbers that are added is a control array - and the number of text boxes in the array can vary (they can be created at run time).

How can I add the numbers in the text boxes if the text box is an array? I thought something like below would do it, but it doesn't:

Private Sub text4_KeyPress(keyascii As Integer)
Dim index As Integer
For index = 1 To Text1.UBound - 1
keyascii = Asc(Chr(keyascii))
If Val(Text4.Text) = Val(Text1.UBound) And keyascii = vbKeyReturn Then
Text3.Visible = True
End If
Next index
End Sub

Any help would be much appreciated!

Slan