R
Rod
The OnOpen event for a report reassigns the .ControlSource property for a
given bound control based on certain criteria. The subform MyChild sits in
the Report Footer:
With "Reports!Report"
If myVar = 1 Then
!myField.ControlSource = "ChangeControlSource"
!myChild!myField.ControlSource = "ChangedControlSource" <= ERROR HERE
End If
End With
(I know I am not properly setting a control variable for the With statement
- in my actual code I am).
The error message tells me I am using an invalid reference when trying to
change the .ControlSource property for the myField control on the subform
myChild. I assume this is because, on the OnOpen event for the parent report,
the subreport is not yet open.
If I try and reassign Reports!Report!myChild!myField.ControlSource in the
OnOpen event of the myChild subform, I am told I cannot change the
..ControlSource property in print preview or once printing has started.
How would I change the .ControlSource of a control in a subreport (prior,
obviously, to OnFormat or OnPrint or the parent report)?
Thank you
given bound control based on certain criteria. The subform MyChild sits in
the Report Footer:
With "Reports!Report"
If myVar = 1 Then
!myField.ControlSource = "ChangeControlSource"
!myChild!myField.ControlSource = "ChangedControlSource" <= ERROR HERE
End If
End With
(I know I am not properly setting a control variable for the With statement
- in my actual code I am).
The error message tells me I am using an invalid reference when trying to
change the .ControlSource property for the myField control on the subform
myChild. I assume this is because, on the OnOpen event for the parent report,
the subreport is not yet open.
If I try and reassign Reports!Report!myChild!myField.ControlSource in the
OnOpen event of the myChild subform, I am told I cannot change the
..ControlSource property in print preview or once printing has started.
How would I change the .ControlSource of a control in a subreport (prior,
obviously, to OnFormat or OnPrint or the parent report)?
Thank you