Hi,
I have a report, within which is a subreport. I would like to be able to change the source object of that subreport to different forms depending on the status of one of the fields of the parent form record.
Basically this main report prints quote details of doors. I would like to display a different subform with different info for a fire door than I would for a ventilated door for example.
The piece of code I am using is as follows:
If [Door Part Number] Like "B*" Then
Me.frm_BDoorDetails.SourceObject = "rpt_Quote/AckBDoor"
Else
Me.frm_BDoorDetails.SourceObject = "rpt_Quote/AckFirelock"
End If
I am running this code on the OnFormat event of the detail record of the parent report. However, when I run the report I get the following error message:
"You can't set the Source Object property in print preview or after printing has started"
Maybe I am running the code on the wrong event?
If anyone can help me out with this I would be eternally grateful!
Thanks in advance
John
I have a report, within which is a subreport. I would like to be able to change the source object of that subreport to different forms depending on the status of one of the fields of the parent form record.
Basically this main report prints quote details of doors. I would like to display a different subform with different info for a fire door than I would for a ventilated door for example.
The piece of code I am using is as follows:
If [Door Part Number] Like "B*" Then
Me.frm_BDoorDetails.SourceObject = "rpt_Quote/AckBDoor"
Else
Me.frm_BDoorDetails.SourceObject = "rpt_Quote/AckFirelock"
End If
I am running this code on the OnFormat event of the detail record of the parent report. However, when I run the report I get the following error message:
"You can't set the Source Object property in print preview or after printing has started"
Maybe I am running the code on the wrong event?
If anyone can help me out with this I would be eternally grateful!
Thanks in advance
John