J
Jason
Hi,
I have created this code which populates values in a report from a form
without using a recordsource in the report.
The problem is that each control in the report gets the same value of a
control in the form. I know i'm forgetting something, but can't figure out
what.
Here's my code:
'ctl1 are the controls in a form and ctl2 are the controls in a report. Both
controls have 'the same names.
dim ctl1 as control
dim ctl2 as control
For Each ctl1 In Form_MyForm.Controls
If ctl1.ControlType = acTextBox Then
For Each ctl2 In Me.Controls
If ctl2.ControlType = acTextBox Then
ctl2.ControlSource = "='" & ctl1 & "'"
End If
Next
End If
Next
I have created this code which populates values in a report from a form
without using a recordsource in the report.
The problem is that each control in the report gets the same value of a
control in the form. I know i'm forgetting something, but can't figure out
what.
Here's my code:
'ctl1 are the controls in a form and ctl2 are the controls in a report. Both
controls have 'the same names.
dim ctl1 as control
dim ctl2 as control
For Each ctl1 In Form_MyForm.Controls
If ctl1.ControlType = acTextBox Then
For Each ctl2 In Me.Controls
If ctl2.ControlType = acTextBox Then
ctl2.ControlSource = "='" & ctl1 & "'"
End If
Next
End If
Next