Private Sub cmdPutinBoxes_Click()
'form name = frmArrays
'Textbox names on the form are as follows
'txtName0
'txtName1
'txtName2
'etc
Dim SomeNumbers(8) As Integer 'an array that holds up to nine integers
Dim i As Integer 'a variable that holds an integer
Dim TextBoxName As Object
'Note: define the loop and go
For i = 0 To 8 'do whatever follows nine times
'Note: the value of i is 0 on the first pass
'Note: the value of i is 1 on the second pass
'Note: the value of i is 2 on the third pass, etc
Set TextBoxName = Forms("frmArrays")("txtName" & i)
' this will read Forms("frmArrays")("txtName0") on the first pass,
' this will read Forms("frmArrays")("txtName1") on the 2nd pass, etc
'assign value to array for this code sample
SomeNumbers(i) = i
TextBoxName = SomeNumbers(i)
'Translation: me.txtName0 = SomeNumbers(0) = on first pass of loop.
'me.txtName1 = SomeNumbers(1) = on 2nd pass of loop, etc
Next i 'Note: go back if not done
'otherwise, leave
End Sub