how to supress horizontal line in last detail of each page?

K

Keith G Hicks

Is there a way (maybe using "retreat" event?) to prevent a horizontal line
from showing up at the bottom of the last detail on each page of a report?
(so that the line ONLY shows up BETWEEN each detail section - not at the top
of the first one and not at the bottom of the last one).

THanks,

Keith
 
M

Marshall Barton

Keith said:
Is there a way (maybe using "retreat" event?) to prevent a horizontal line
from showing up at the bottom of the last detail on each page of a report?
(so that the line ONLY shows up BETWEEN each detail section - not at the top
of the first one and not at the bottom of the last one).

Use a line counter text box in the detail section so you can
tell whwhich detail you're working on. Add a text box named
txtLineCount with expression =1 and RunningSum set to Over
Group.

Now, you need to know how many details are in each group son
you can determine if you're working on the last detail. Add
a text box named txtGroupLines to the group header section
with expression =Count(*)

Then you can use code in the detail section Format event to
make the line visible or not:

Me.theline.Visible = (Me.txtLineCount < Me.txtGroupLines)
 
K

Keith G Hicks

Marsh,

Thanks for the tip. However, this seems to work fine with groups but I need
to do it per page, not per group. When I put =Count(*) textbox in the page
header, it returns an error. What do you suggest? Maybe I did something
wrong?

THanks,

Keith
 
M

Marshall Barton

Keith said:
Thanks for the tip. However, this seems to work fine with groups but I need
to do it per page, not per group. When I put =Count(*) textbox in the page
header, it returns an error. What do you suggest? Maybe I did something
wrong?

Sorry Keith, I missed the part about each page. So, no, you
didn't do anything wrong. I just answered the wrong
question.

You can force a two pass report by using a control with an
=Pages text box in the page header or footer. During the
first pass, use the page footer Format event to populate an
array with the the PK of the last detail on the page. Then,
in the second pass, use the detail section Format event to
make the visible or not accordingly. Here's some sample
code:

Dim alngPages(1000)

Private Sub Detail_Format( . . .
lnBottom.Visible = (alngPages(Me.Page) <> txtKey)
End Sub

Private Sub PageFooter_Format( . . .
If Me.Pages = 0 Then
alngPages(Me.Page) = txtKey
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top