Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Keep Group Footer with last detail record

Posted on 2013-06-06
3
Medium Priority
?
1,175 Views
Last Modified: 2013-06-10
Hi all, hope someone can help with an Access 2007 report.  The problem I'm having is that if I have enough detail records in grouped report, the group footer will be printed on the following page with the group header.  This is result is like the attached image.

Report Top/Bottom Margins = .5"

Report Header:
Height = 1.5"
Auto Height = No
Can Shrink/Grow = No
Keep Together = Yes
Force New Page = None

Page Header:
Height = .375"
Auto Height = No

Group Header:
Height = .9583"
Auto Height = No
Can Grow/Shrink = No
Keep Together = Yes
Repeat Section = Yes
Force New Page = None
Keep header and first detail together is turned on in the Group, Sort, and Total section

Detail:
Height = .2083"
Auto Height = No
Can Shrink/Grow = Now
Keep Together = Yes
Force New Page = None

Group Footer:
Height = .0416"
Auto Height = No
Can Shrink/Grow = No
Keep Together = Yes
Force New Page = None

Page Footer:
Height = .1667"
Auto Height = No

Report Footer:
Height = 2.2083"
Auto Height = No
Can Grow/Shrink = No
Keep Together = Yes
Force New Page = None

I was able to solve the issue by putting a page break at the top of the detail section and adding the following code in Detail_Format, a suggestion I found on the Internet.

    If Report.Top + Me.infracFooter.Height > 10619 Then

        Me.PageBreak1.Visible = True

    Else

        Me.PageBreak1.Visible = False

    End If

Everything seems to work, but I arrived at the '10619' value by trial and error and can't test every permutaion of the report because it can be filtered by several criteria and each group may have a different number of detail records.

Is anyone familiar with this type of set up and if so, can you tell me how I can reliably calculate the correct value to replace '10619'?  Or, is there a better way to do this?

If any additional information is needed, please let me know.

TIA
sample.png
0
Comment
Question by:2030penn
[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
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 39227434
Your using the right technique.  

What your looking for though is the page size, less margins, less footer size, less current position must be greater then the height of the detail section.

 Keep in mind though that the report engine works in twips (1" = 1440 twips).

 So:

   (10*1440) - (.0416*1440) - Report.Top >  (.2083*1440)

 then it will fit.

Jim.
0
 

Author Comment

by:2030penn
ID: 39230102
Thanks for the quick reply, Jim.  I will take a look with the information you've provided and will post back how things work out.  I appreciate your assistance.
0
 

Author Comment

by:2030penn
ID: 39235731
Hi Jim,

This works well; much better than trial and error, and hard coding heights.  I really appreciate your assistance.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

722 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