Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2004

Tip: Looking for answers? Try searching our database.

Page Numbering SubReports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tamiyra - 07 Oct 2004 17:07 GMT
Hi,

If anyone could help it would be great,

My report is setup like this:

subrpt1
subrpt2
subrpt3
subrpt4

All the subreports are their own report, the main report combines them all
to make a report package.

What I have been trying to figure out is how to keep the original page
numbers of the subreports. but the page number just appears as 0's once the
reports are viewed from the main report.  I have tried making my own page
counter which works and increments properly when the subreport is viewed by
itseld, however it does not increment properly when the subreport is
displayed from the main report.  Is there a way to do this or am I trying to
do something that is impossible?

Thanks,
Marshall Barton - 11 Oct 2004 06:16 GMT
>My report is setup like this:
>
[quoted text clipped - 13 lines]
>displayed from the main report.  Is there a way to do this or am I trying to
>do something that is impossible?

I've been thinking about this all weekend and I believe it's
possible to get that effect.  You can not display the page
header/footer sections in a subreport, so we'll have to get
tricky with the main report page numbers.  Since you didn't
explain much about how the subreports are arranged in the
main report, I can't be specific.

Here's some thoughts on this subject.  Place an invisible
text box named txtStartPage on the main report, probably in
the report header section.

Add some code to somewhere(?) (could some main report
section's Format event, or in the subreport's Open event or
in the subreport header's Format event).  In the main
report, the code would be:
    Me.txtStartPage = Me.Page
or in the subreport:
    Parent.txtStartPage = Parent.Page

Now, the main report's footer section can display the
subreport's page number in a text box using the expression:
    =Page - txtStartPage  + 1

I do hope you've done something to get each subreport to
start on a new page.

Signature

Marsh
MVP [MS Access]

Tamiyra - 12 Oct 2004 14:29 GMT
Yes I have each report starting on a new page, it was only difficult for the
first report because it is a variable length.
This is the code I used for that in case it can help others... searching the
forum

If Me.rptIncomeSummary.Report.HasData Then
   If Me.rpt1099Broker.Report.HasData Or Me.rpt1099Div.Report.HasData Or
Me.rpt1099Int.Report.HasData Then
       Me.pgbrkA.Visible = True
       basPageCount.resetpgnumber
   Else
       Me.pgbrkA.Visible = False
   End If
Else
       Me.pgbrkA.Visible = False
End If

In regards to how my report is set up all the reports are linked based on a
client account number and they are all in the details sections of the main
report.
I may have to switch this around to try what you are saying, but will post
if I am successful in the attempt or not.

> >My report is setup like this:
> >
[quoted text clipped - 39 lines]
> I do hope you've done something to get each subreport to
> start on a new page.
Tamiyra - 12 Oct 2004 14:49 GMT
Ok I will try to be more specific in describing my problem here, cause i
attempted to code what you suggested but became totally lost..

My main report consists of a detail section only. In that detail section
there are 4 subreports and that is it.(other than a page break after the
first subreport)

Subreport1
subreport2
subreport3
subreport4

Subreport 3 and 4 are both one page long always and do no require th page
numbers to be on them.

Subreports 1 and 4 are basically set up the same,  a header for the account
number then a details sections that lists all the detail lines. The page
numbers must be displayed in the subreport headers along with the other
information that is there.

And the page numbers must number the pages in these subreports starting at
one for the first page that is in each report.  The way I have it now, both
reports show the numbers correctly when ran alone, but when called from the
main report, the [page] variable doesn't pass correctly and is displayed as
0's on all pages in all reports.   I want to keep the page number the same on
these reports as it was when I ran the reports by themselves.  So that it
resets the page number at the beginning of a new report.  I have tried using
variable and such, which I can get working when running the subreports by
themselves, but as soon as they are ran from the main report, all hell breaks
loose and it calls the onformat command a crazy amount of times which then
disrupts the counters that I have in place.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.