CONTROL'S VALUE IN AN ARRAY - HELP
My objective is to copy all the values from one record (from a form) to another new record.
I am thinking of using the For each ctl.. Next Ctl.
First I would create an array with upperbound of the number of textbox controls.
then For each control, I would assign the the value of the control to the array, one by one.
My problem, everytime I get to the part
X(i) = ctl.value, There is nothing in there.
dim ctr as integer 'ctr= number of controls
dim i as integer, ctl as control
i = 0
ReDim x(ctr)
MsgBox "X(CTR) " & x(ctr)
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
MsgBox "ctl.value " & ctl.Value
x(i) = ctl.Value
i = i + 1
MsgBox "x(i) ) " & x(i)
' THE ABOVE GIVES ME x(i)) WITHOUT THE VALUE OF THE x(i)
End If
Next ctl
???
My objective is to copy all the values from one record (from a form) to another new record.
I am thinking of using the For each ctl.. Next Ctl.
First I would create an array with upperbound of the number of textbox controls.
then For each control, I would assign the the value of the control to the array, one by one.
My problem, everytime I get to the part
X(i) = ctl.value, There is nothing in there.
dim ctr as integer 'ctr= number of controls
dim i as integer, ctl as control
i = 0
ReDim x(ctr)
MsgBox "X(CTR) " & x(ctr)
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
MsgBox "ctl.value " & ctl.Value
x(i) = ctl.Value
i = i + 1
MsgBox "x(i) ) " & x(i)
' THE ABOVE GIVES ME x(i)) WITHOUT THE VALUE OF THE x(i)
End If
Next ctl
???