Solved

access 2010 report page numbering

Posted on 2013-01-08
8
371 Views
Last Modified: 2013-01-08
I have an access report grouped on employee.  I want a new page for each employee.  To stop both blank page at end, and empty first page after report header, I use the following vba:

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
    'after first name change, set FORCE NEW PAGE to be before change in name - this will stop a blank page being printed at end of report
    Me.Section(acGroupLevel1Header).ForceNewPage = 1 'before change in name

End Sub

Open in new window


This works well, except for the auto numbering page x of y.
I end up with page 40 of 28 on the last page of this report.
How can I fix this?
0
Comment
Question by:MonkeyPie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38756494
Not sure why you are getting a blank page.
Perhaps it would be better to examine the design of your report to eliminate the blank/last page...
0
 

Author Comment

by:MonkeyPie
ID: 38756517
If I want to take new page for each employee, without using VBA, I either have to set 'force new page' to TRUE for before new employee (which would give me the report header on one page, and then take a new page to start first employee - which I don't want), or I could set 'force new page' for after employee footer - which would give me a new page after last employee.

Or am I wrong here?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38756559
You are correct, my point was that depending on your exact design, there may be another way to control the breaks and pagecounts

In other words, (unless I am missing something here)
It would be best to post a sample DB of this.

With reports, there are just too many settings that can effect things like this...

Sample database notes:
1. Back up your database(s).
2. Combine the front and back ends into one database file.
3. Remove any startup options, unless they are relevant to the issue.
4. Remove any records unless they are relevant to the issue.
5. Delete any objects that do not relate directly to the issue.
6. Remove any references to any "linked" files (files outside of the database, Images, OLE Files, ...etc)
7. Remove any references to any third party Active-x Controls (unless they are relevant to the issue)
8. Remove, obfuscate, encrypt, or otherwise disguise, any sensitive data.
9. Unhide any hidden database objects
10. Compile the code. (From the VBA code window, click: Debug-->Compile)
11. Run the compact/Repair utility.
12. Remove any Passwords and/or security.
13. If a form is involved in the issue, set the Modal and Popup properties to: No
    (Again, unless these properties are associated with the issue)
14. Post the explicit steps to replicate the issue.
15. Test the database before posting.

In other words, ...post a database that we can easily open and immediately see and/or troubleshoot the issue.
And if applicable, also include a clear graphical representation of the *Exact* results you are expecting, based on the sample data.

JeffCoachman
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 400 total points
ID: 38756632
For example, see this report.

It is set to break after each group *unless* all the records have already been displayed.
Database75.mdb
0
 

Author Comment

by:MonkeyPie
ID: 38756635
Jeff - this is a generic problem that I have now, and also in the past with other applications.

The general layout required is:
report header
first group header/detail/footer
page break
2nd group header/detail/footer
page break
last group header/detail/footer

All with page numbering in page footer with format 'page x of y'

So, it is not just one report, but many.  This layout is fairly standard.  What do others do to stop blank page at end, if they use 'force new page after section'

Thanks,
Sue
0
 

Author Comment

by:MonkeyPie
ID: 38756639
Sorry - just missed your last message - will look at sample now.
0
 

Author Closing Comment

by:MonkeyPie
ID: 38756742
I did as your sample db.  Fantastic.  That is a much better solution.  Thank you.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38756772
Great, Thanks...

Just a note though...
Because my solution uses VBA code, this will only work if the report is opened in Print Preview.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question