jaaret
Instructor
- Jun 19, 2002
- 171
I have a subreport that I use in several reports. Some of the reports are vertical, others are horizontal. I want to dynamically change the width of the subreport and one of the text boxes in it depending on which main report is selected.
I think this code should work but I haven't found the event that will make it work successfully:
'Widen the width if a horizontally oriented report is selected
If Form_frmReports.cmbReportID = 75 Then
Report_rsubAttendees.Width = 14400
Report_rsubAttendees.txtNames.Width = 11880
Else
Report_rsubAttendees.Width = 10080
Report_rsubAttendeeNamesH1.txtNames.Width = 8280
End If
When I place this in with the Print Preview command button or on the main report's On Open event I receive the error:
"You can't set the width property in print preview or after printing has started"
When I place this code in the subform's On Open event I do not receive an ereror message but the width's are not affected. What event will successfully trigger this?
Thanks in advance,
Jaaret
I think this code should work but I haven't found the event that will make it work successfully:
'Widen the width if a horizontally oriented report is selected
If Form_frmReports.cmbReportID = 75 Then
Report_rsubAttendees.Width = 14400
Report_rsubAttendees.txtNames.Width = 11880
Else
Report_rsubAttendees.Width = 10080
Report_rsubAttendeeNamesH1.txtNames.Width = 8280
End If
When I place this in with the Print Preview command button or on the main report's On Open event I receive the error:
"You can't set the width property in print preview or after printing has started"
When I place this code in the subform's On Open event I do not receive an ereror message but the width's are not affected. What event will successfully trigger this?
Thanks in advance,
Jaaret