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
Solved

access 2010 report page numbering

Posted on 2013-01-08
8
369 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
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

809 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