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
  #11  
Old January 15th, 2007, 06:07 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.modulesdaovba,microsoft.public.access.reports
George Nicholson
external usenet poster
 
Posts: 791
Default How to copy all report info to a new blank report

The CopyObject method mimics the manual process of selecting a db object &
doing a copy/paste.

Aircode adapted from a couple of Help entries:

Dim obj As AccessObject
Dim dbs As Object
Set dbs = Application.CurrentProject

For Each obj In dbs.AllReports
DoCmd.CopyObject, "Copy of " obj.Name, acReport, obj.Name
Next obj

This assumes you are using Access 2000(?) or higher. Fairly certain that's
when CurrentProject, AllReports and AccessObject were introduced to the
Access object model.



"Bernie" wrote in message
...
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 12:34 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.