Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start Page Number based on Last Page of Another Report

Status
Not open for further replies.

sxschech

Technical User
Jul 11, 2002
1,032
0
36
US
Hi,
I saw this thread

thread181-143786

and was wondering if there is a technique when you need to only print (or reprint) a report and have it begin at the last page number without having to rerun all the reports that precede it?

Example:

Report 1 Contains 10 pages
Report 2 should begin at Page 11 and it has 2 pages (Page 11, Page 12)
Report 3 should begin at Page 13 and has one page (Page 13)
Report 4 should begin at Page 14 and it has 4 pages (Page 14, Page 15, Page 16, Page 17)


Let's say I want to (re)print Report 4 because the data for that report changed, in that case, based on above, I would expect that the report would display Page 14 and the last page of the report would display Page 17. The other issue is that sometimes the prior reports may have a different number of pages, so that is why wouldn't be able to hard code the starting points.

The other technique ( I saw in a web search was similar but suggested as each report is run, pass the page number to a text box on a form and refer to the form to get the next page number. There again, that relies on having to run all the reports in sequence.

I suppose I may have to build a table and store the page counts there, but will need to figure out a way to properly sequence since if I or someone else runs a report on its own as there has to be a way to identify the sequence of what comes before and of course if new reports are added in between, then have to reconfigure the sequence.

Perhaps I'll continue to leave off page numbers to keep things simple as I've been doing.
 
Depending on the version of Access you are using you may consider the TempVars collection instead of the Global Variable.

What happens when you want to re-run report 1,2 or 3 and it is more or less pages?

If you want to be able to do it, you could either set the global/tempvar/control on form that is your page number instead of resetting to 0 as the referenced thread suggests. Whether you do this with stored records or manual input is up to you.

However the fact that this is a single report to me (numberd with all pages in sequence) instead of 4 seperate reports, suggests to me you really do not want to do this. What if there is a change that impacts all 4 datasets and the report is only valid in time.

If the report changes overtime, put a date and possibly time on it. If you reprint a section, the sections will at least have different times.
 
Hi lameid,

Thanks for responding. Using Access Version 2010 SP1. The four reports are combined into one overall report, a cover page, a summary report, a detail report and a chart report.

To clarify, I would be reprinting and combining one or more of these reports during the editing phase or down the road if they decide on changing some wording or correcting something that only impacts the particular report rather than all the reports that get combined. If all the reports were impacted then there wouldn't be a question about being able to only print out one report for recombining. The reports already have a date and time stamp on them along with the page number.
 
IMO it seems like a lot of work for a maybe... But I stand by my answer you should be able to just set your page value instead of over writing it.

Tempvars was introduce in Access 2007. Works like global variables but does not get reset like a global can if code fails. It is also Macro freindly which means that in theory it works with Access Web Services for Sharepoint (or whatever the exact name is).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top