0
-003KobeBrian
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.
different reports automatically? Thanks.
-003KobeBrian said:When I tried to insert a report, I use the following code and I got the
error message "type mismatch". reportheader is the subreport existed. and
I want it to assign to the new report as a subreport.
Set ctl = CreateReportControl(rpt.Name, acSubform, acPageHeader, ,
Reports![reportheader])
And how do you assign name to this command. Please help. Thanks.
Klatuu said:CurrentProject.AllReports is a collection of report objects. You can
spin
through it and get the names of all the reports.
Alex Dybenko said:Hi,
not sure that you need to pass Reports![reportheader], try leave it out.
once you get a reference to ctl - you can then set it other properties
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
-003KobeBrian said:When I tried to insert a report, I use the following code and I got the
error message "type mismatch". reportheader is the subreport existed.
and I want it to assign to the new report as a subreport.
Set ctl = CreateReportControl(rpt.Name, acSubform, acPageHeader, ,
Reports![reportheader])
And how do you assign name to this command. Please help. Thanks.
Klatuu said:CurrentProject.AllReports is a collection of report objects. You can
spin
through it and get the names of all the reports.
:
Thanks again, Alex. If I want to put the code in module and scan all
the
reports and insert, do you know how to do it once for all instead of
one by
one? Something like where I can get all the report names in the mdb.
Thanks.
Hi,
Do not see any problem with this - you have to open each report in
design
mode using docmd.openreport, then add new control using
CreateControl, and
then format it as required.
The tricky part if you have other controls on the section where you
insert
subreport - then you have to move existing control around it
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.
-003KobeBrian said:How do you pass the source control to ctl? What is the syntax? THanks.
Alex Dybenko said:Hi,
not sure that you need to pass Reports![reportheader], try leave it out.
once you get a reference to ctl - you can then set it other properties
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
-003KobeBrian said:When I tried to insert a report, I use the following code and I got the
error message "type mismatch". reportheader is the subreport existed.
and I want it to assign to the new report as a subreport.
Set ctl = CreateReportControl(rpt.Name, acSubform, acPageHeader, ,
Reports![reportheader])
And how do you assign name to this command. Please help. Thanks.
CurrentProject.AllReports is a collection of report objects. You can
spin
through it and get the names of all the reports.
:
Thanks again, Alex. If I want to put the code in module and scan all
the
reports and insert, do you know how to do it once for all instead of
one by
one? Something like where I can get all the report names in the mdb.
Thanks.
Hi,
Do not see any problem with this - you have to open each report in
design
mode using docmd.openreport, then add new control using
CreateControl, and
then format it as required.
The tricky part if you have other controls on the section where you
insert
subreport - then you have to move existing control around it
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.