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!

Line number

Status
Not open for further replies.

TheRealDeal

Technical User
Nov 16, 2001
187
US
Is it possible to check for a line number within a report and know if a section is repeating to another page? In my dBase days, I would be able to check the line number before printing a section's details to determine if I would need a "Continue..." statement before concluding the section another page.
 
TheRealDeal
Would this work for you?

1. Put a Label "Continued..." in the Page Footer.
2. In the OnFormat event for the detail section put
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.FormatCount > 1 Then
Me.YourLabelName.Visible = True
Else: YourLabelName.Visible = False
End If
End Sub

Tom
 
I did what you said and it is still not displaying. The Formatcount - what causes this variable to increment?
 
Okay, I'll go back to the drawing boards. It appears that Access increments a section's FormatCount property each time it executes the Format event for that section, and then it resets the FormatCount property to 0.

I have something somewhere that does exactly what you want. I'll find it.

Tom
 
Here's a link that shows one method to do what you want.


I'm convinced there's an easier way, without using a module. I have fooled around with the WillContinue property but I can't get it to work out the way it should.

If I come up with something more, I'll post it.

Tom
 
For example, the following, according to my logic, should work...

1. Place a "Continued..." label in the page footer
2. In the Detail section OnFormat event, put
If Me.Section(acDetail).WillContinue = True Then
Me.Labelxx.Visible = True
Else: Me.Labelxx.Visible = False
End If

What happens is that it prints "Continued..." on the second page of the report, not the first.

Arghhh!

Tom

 
Actually, this works, using the HasContinued property, but it might not be exactly what you want...

1. Put label "Continued" in page footer section
2. In the Detail section's OnFormat event, put
If Me.Section(acDetail).HasContinued = True Then
Me.YourLabelName.Visible = True
Else: Me.YourLabelName.Visible = False
End If

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top