Solved

access 2010 report page numbering

Posted on 2013-01-08
8
365 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
  • 4
  • 4
8 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 400 total points
Comment Utility
For example, see this report.

It is set to break after each group *unless* all the records have already been displayed.
Database75.mdb
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:MonkeyPie
Comment Utility
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
Comment Utility
Sorry - just missed your last message - will look at sample now.
0
 

Author Closing Comment

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

Expert Comment

by:Jeffrey Coachman
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now