I have some code, which opens a report containing a subreport. The recordsource for the subreport is dynamically set with the on_open event of the subreport.
On the click of a button on my form, the report opens and the subreport displays the correct information as per the recordsource.
BUT....
Now I have added one line of code after the report is opened:
This code works by itself...the subreport displays correct information when the report is opened
As soon as I add this line of code following the above line of code, I get "Runtime Error 2191 - You can't set the recordsource property after printing has started"
I tried using the SendObject method in different places, but no luck.
Any ideas????
Thanks in advance,
BJS
On the click of a button on my form, the report opens and the subreport displays the correct information as per the recordsource.
BUT....
Now I have added one line of code after the report is opened:
This code works by itself...the subreport displays correct information when the report is opened
Code:
DoCmd.OpenReport "rptReturnToWorkNotice", acViewPreview
As soon as I add this line of code following the above line of code, I get "Runtime Error 2191 - You can't set the recordsource property after printing has started"
Code:
DoCmd.SendObject acSendReport, "rptMainReport", "Snapshot Format", Me.Email, , , Me.Subject & " - " & Me.ename, Me.Body, 0
I tried using the SendObject method in different places, but no luck.
Any ideas????
Thanks in advance,
BJS