Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HasContinued not working? 1

Status
Not open for further replies.

ddub

MIS
Jul 9, 2002
17
US
Hi,

I need to be able to not print some fields from a group header if the detail records span more than one page. For instance, if group record AGR100 has detail records that go over one page, I don't need to show the field txtBaseFY1A in the group header for AGR100's subsequent pages. The group header's Repeat Section property is set to yes because I need to display the group header on every page.

I tried the following code, but it does not seem to work:

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)

If Me.Detail.HasContinued = True Then
Me.txtBaseFY1A.Visible = False
Else
Me.txtBaseFY1A.Visible = True
End If

End Sub

Any idea what the problem could be?

Thanks,
ddub
 
To the best of my knowledge HasContinued HasNever worked. I wish someone would prove me wrong but I've been thru a number of discussion on this and no one that I'm aware of has ever gotten it to work.

Paul
 
ddub,

Try your code in the On Format event instead of the On Print event. It should work there.....
 
Thanks for the advice but unfortunately, I think Paul is correct when he said that HasContinued has never worked. Even moving the code to the On Format event did not work. If anyone has a workaround to this problem, please let me know.

Thanks again,
ddub
 
This seems to do it.

Option Compare Database
Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim grpPage As Integer, GrpPages As Integer


Private Sub pageheader0_Format(Cancel As Integer, FormatCount As Integer)
Dim I As Integer
If Me.pages = 0 Then
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
GrpNameCurrent = Reports![Generating_Dictionary]![FILENAME]
If GrpNameCurrent = GrpNamePrevious Then
GrpArrayPage(Me.Page) = GrpArrayPage(Me.Page - 1) + 1
GrpPages = GrpArrayPage(Me.Page)
For I = Me.Page - ((GrpPages) - 1) To Me.Page
GrpArrayPages(I) = GrpPages
Next I
Else
grpPage = 1
GrpArrayPage(Me.Page) = grpPage
GrpArrayPages(Me.Page) = grpPage
End If
Else
Me!ctlGrpPages = "Page " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
Me!ctlGrpPage = GrpArrayPage(Me.Page)
End If
If GrpArrayPage(Me.Page) > 1 Then
Me.FILENAME.Visible = False
Else
Me.FILENAME.Visible = True
End If


GrpNamePrevious = GrpNameCurrent
End Sub
You need a textbox in the Page Header named ctlGrpPages. You can set it's visible property to no and still have it work. Then you can put your Group textbox in either the Page Header or Group header and it should work. Reports![Generating_Dictionary]![FILENAME] is the name of the textbox in my Group Header. I tested it out and it seems OK. Try it and let me know how it goes.

Paul
 
Hey Paul, it worked great! Thanks for all your help, you get a star!

ddub
 
Thanks, most of that star goes to The Access Web. I beleive that's where the Group Page/Pages code came from. I've used it for years to get Page of Pages info onto Reports.
Glad it worked.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top