Solved

access 2010 report page numbering

Posted on 2013-01-08
8
370 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
auto-fill field(s) in Access data entry form 17 46
MS Access Combobox to Disable Controls on a Separate Form 10 26
Error 438 6 18
vb.net dbnull syntax 1 12
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

730 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