By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

make visible based on pages in Group in Report

MMcCarthy
Expert Mod 10K+
P: 14,534
Interesting title isn't it.

Ok everyone, I have a problem and I'm hoping some of you genius's have a solution.

I have a Report which after being printed will have the pages run through an automated process. The process needs to know when each group has finished. This will be done using visual aid of 3 lines. The first line is a marker and will aways be visible on the page. The second line will be visible on all pages in the group except the last page of the group. The third line will only be visible on the last page of the group.

Each group will start on a new page but I'm stumped on how to work out how many pages are in the group. The report page numbering will only count how many pages are in the report as a whole. I know I can print each group individually but I'm looking for a better solution.

All suggestions welcome.

Mary

P.S. Please ask any questions if this doesn't make sense. It's a difficult situation to explain.
Mar 14 '07 #1
Share this Question
Share on Google+
8 Replies


NeoPa
Expert Mod 15k+
P: 31,473
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public lngPage As Long
  5.  
  6. Private Sub RouteHdr_Format(Cancel As Integer, FormatCount As Integer)
  7.     lngPage = Page - 1
  8. End Sub
Does this give you enough information?
Mar 14 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public lngPage As Long
  5.  
  6. Private Sub RouteHdr_Format(Cancel As Integer, FormatCount As Integer)
  7.     lngPage = Page - 1
  8. End Sub
Does this give you enough information?
I kinda get where you're going but I'm not sure. Can I ring you?
Mar 14 '07 #3

Rabbit
Expert Mod 10K+
P: 12,364
I haven't read the whole thing but it sounds close to what you want.
How to reset the page number and the total page count for each group in a Microsoft Access report.
Mar 14 '07 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
I haven't read the whole thing but it sounds close to what you want.
How to reset the page number and the total page count for each group in a Microsoft Access report.
Now I get what Ade was on about. Thanks a million Rabbit.
Mar 14 '07 #5

Rabbit
Expert Mod 10K+
P: 12,364
Now I get what Ade was on about. Thanks a million Rabbit.
No problem.
Mar 14 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
No problem.
Still I'd love to find a way to avoid creating that table.
Mar 14 '07 #7

NeoPa
Expert Mod 15k+
P: 31,473
I kinda get where you're going but I'm not sure. Can I ring you?
Course you can.
Sorry - I was AFK watching Spurs.
Mar 14 '07 #8

MMcCarthy
Expert Mod 10K+
P: 14,534
Course you can.
Sorry - I was AFK watching Spurs.
Thanks everyone. With Ade's help I have managed to get the lines to work in the Code footer but not the header. The header Format is processed first and therefore cannot have anything triggered by the group header and footer. Hopefully this will be an accepted solution.

For anyone who's interested, please see the template code below. linestop and lineparity are the two lines that have to be made visible or invisible.

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public lngPage As Long
  5.  
  6. Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
  7.  
  8.     Me.linestop.Visible = True
  9.     Me.lineparity.Visible = False
  10.  
  11. End Sub
  12.  
  13. Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
  14.  
  15.     Me.linestop.Visible = False
  16.     Me.lineparity.Visible = True
  17.     lngPage = Page - 1
  18.  
  19. End Sub
  20.  
  21. Function PageNo()
  22.     PageNo = "Page " & [Page] - [lngPage]
  23. End Function
  24.  
Mary
Mar 15 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.