A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

insert header to report automatically



 
 
Thread Tools Display Modes
  #1  
Old November 22nd, 2006, 04:34 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
-003KobeBrian
external usenet poster
 
Posts: 29
Default insert header to report automatically

Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.


  #2  
Old November 22nd, 2006, 05:20 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
Alex Dybenko
external usenet poster
 
Posts: 85
Default insert header to report automatically

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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.


  #3  
Old November 22nd, 2006, 05:42 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
-003KobeBrian
external usenet poster
 
Posts: 29
Default insert header to report automatically

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.




  #4  
Old November 22nd, 2006, 06:49 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
Klatuu
external usenet poster
 
Posts: 7,074
Default insert header to report automatically

CurrentProject.AllReports is a collection of report objects. You can spin
through it and get the names of all the reports.

"-003KobeBrian" wrote:

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.





  #5  
Old November 23rd, 2006, 02:54 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
-003KobeBrian
external usenet poster
 
Posts: 29
Default insert header to report automatically

I couldn't find the currentproject.allreports in access97. I found the
application.reports. But this is the open report. How do I use all reports
including open and non-open ones? Thanks.



"Klatuu" wrote in message
...
CurrentProject.AllReports is a collection of report objects. You can spin
through it and get the names of all the reports.

"-003KobeBrian" wrote:

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.







  #6  
Old November 23rd, 2006, 03:33 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
-003KobeBrian
external usenet poster
 
Posts: 29
Default insert header to report automatically

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" wrote in message
...
CurrentProject.AllReports is a collection of report objects. You can spin
through it and get the names of all the reports.

"-003KobeBrian" wrote:

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.







  #7  
Old November 23rd, 2006, 08:44 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
Alex Dybenko
external usenet poster
 
Posts: 85
Default insert header to report automatically

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" wrote in message
...
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" wrote in message
...
CurrentProject.AllReports is a collection of report objects. You can
spin
through it and get the names of all the reports.

"-003KobeBrian" wrote:

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.








  #8  
Old November 24th, 2006, 12:14 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
-003KobeBrian
external usenet poster
 
Posts: 29
Default insert header to report automatically

How do you pass the source control to ctl? What is the syntax? THanks.


"Alex Dybenko" wrote in message
...
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" wrote in message
...
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" wrote in message
...
CurrentProject.AllReports is a collection of report objects. You can
spin
through it and get the names of all the reports.

"-003KobeBrian" wrote:

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.










  #9  
Old November 24th, 2006, 06:45 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
Alex Dybenko
external usenet poster
 
Posts: 85
Default insert header to report automatically

I think using SourceObject

ctl.SourceObject="Mysubform"

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

"-003KobeBrian" wrote in message
...
How do you pass the source control to ctl? What is the syntax? THanks.


"Alex Dybenko" wrote in message
...
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" wrote in message
...
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" wrote in message
...
CurrentProject.AllReports is a collection of report objects. You can
spin
through it and get the names of all the reports.

"-003KobeBrian" wrote:

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.

"Alex Dybenko" wrote in message
...
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

"-003KobeBrian" wrote in message
...
Is there a way to write a code to insert the same subreport to many
different reports automatically? Thanks.











  #10  
Old January 15th, 2007, 05:40 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
Bernie
external usenet poster
 
Posts: 125
Default How to copy all report info to a new blank report

I need to copy, using code, all objects from a report into a new blank
report. What about the grouping and sorting?
This is a fix for reports which have a bug which causes them to crash on the
NoData event. I copied some manually and that fixed the problem.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.