Line at bottom of Detail section

W

wallymeister

How can I programmatically know when I am at the last item of detail section
in OnPrint event procedure. I need to make a line visible then and only then.

Thanks,
Wally
 
D

Duane Hookom

Can't you simply use a line at the top of the next section?
Otherwise, you can add a get a count of the number of records by adding a
text box to the report header section:
Name: txtCountRpt
Control Source: =Count(*)
Visible: No
Then add a text box to the detail section:
Name: txtCountDetail
Control Source: =1
Running Sum: Over All
Visible: No
Then in the On Format or On Print event you can compare the values:
Me.LineControlName.Visible = (Me.txtCountRpt = Me.txtCountDetail)

You could also use the Line method to draw a line if you don't want to use a
line control.
 
W

wallymeister

Hi Duane,
A line at the top of the next section will not print where I need it to in
the case that my detail section has fewer records tha a full page. the next
section is page footer.

Looks like your other suggestion will work for me but, why would I need to
add a txtbox to the detail section. I already have code that is counting the
times the detail section is firing, so couldn't I just add code something
like this...

If MyCount = Me.txtCountRpt Then
Me.DetailBottomLine.Visible = TRUE
End If

Either way I'm sure I can get it to work now.
Thanks for your quick reply. You guys are awesome.
Wally
 
W

wallymeister

Duane,
After trying it my way it didn't work, I would have swore it would but it
didn't, so I tried your suggestion and the txtCountRpt in the Header section
just retains a value of 7298 which I believe is the total records that are
being printed. (several pages)
e.g. 7298/41=178 pages. On the last page (p178) the line prints just like I
want so I'm thinking that I have to either put that Textbox in Page Section
or a Sort/Group Section.

Well it didn't work in page Header, so I might have to do something else.
Wait, How about if I just change the Running sum to OverGroup. Yeah, that's
the ticket.

Nope that didn't work either. I'm outta time right now. So I'll be back
later tomorrow to see if you have any more suggestions.

Sorry so vague,
Wally
 
D

Duane Hookom

I never trust "code that is counting the times the detail section is firing".
I have never had issues with running sums in controls and have answered
countless questions where OPs were having issues with "code that is counting
the times the detail section is firing".
 
D

Duane Hookom

Apparently you withheld important requirements that are still elusive. Your
original posting made no mention of multiple sections or lines. Now you are
mentioning something about pages adn groups which weren't part of any earlier
specification.

Please clear up my confusion by posting your exact requirements.
 
W

wallymeister

Duane,
Sorry so vague, as I didn't believe at first that those gory details would
make a difference, but I see now it does, anyway let me try to explain better
what I have and am trying to do.

The report has
Report Header (ht = 0)
Page Header (has several controls)
Group Header (Release #)
Group Header (Seq #)
Group Header (Model #)
Detail Section (has several controls that will print somewhere between 30 to
42 lines per page)
Page Footer

I have a line at the top of the Detail Section that will print the 1st time
through across the entire width of the report. All the remaining records do
not print this line as the first control in the detail section will appear
something like shown below.
____________________________________________________ Top line visible
My 1st Assy | Part # | Note | Drawing # | Check |
|----------------------------------------------------|
..Visible=False | Part # | Note | Drawing # | Check |
|----------------------------------------------------|
..Visible=False | Part # | Note | Drawing # | Check |
|----------------------------------------------------|
..Visible=False | Part # | Note | Drawing # | Check |
____________________________________________________ Top line visible
My Last Assy | Part # | Note | Drawing # | Check |
|-----------------------------------------------------|
..Visible=False | Part # | Note | Drawing # | Check |

|-----------------------------------------------------|
^ Need Bottom line made
visible here
^ Box not complete here

Every time the Assy Name changes the top line is made visible again so a
solid line goes across the entire report to complete the assy ctl box. The
Part#; Note; Drawing#; etc. have their borders visible but the Assy ctl has
no borders so top line and left vertical line complete the box around the
Assy Grouping except the last group. I need to be able to identify the last
detail section item so I can make it visible to complete last grouping box.

I hope this explains my problem well enough to understand fully. If I could
attach a file I could show you graphically, but....

Thanks for your willingnes to help me out with this.
Wally
 
D

Duane Hookom

Why don't you just group on Assy value so you can either place lines in the
group header or footer. You could also count() records in a group, use
running sum over group, and code like I suggested earlier except not over all.
 

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