place horizontal line under detail section

  • Thread starter Steel via AccessMonster.com
  • Start date
S

Steel via AccessMonster.com

I currently have a multiple page report that I created that I have placed
horizontal lines within. However, I cannot seem to figure out how to place a
horizontal line under the detail section of the first page and have it
consistently connect with the border around the rest of the detail section.
I have used the line method in the on print event to create left and right
horizontal border lines around the group header and detail section using Me.
Line (0, 0)-(0, .Height) and Me.Line (.Width, 0)-(.Width, .Height) and a line
that is at the top of the report footer using Me.Line (0, 0)-(.Width, 0)......
....this works fine. However, if I try to create a border under the detail
section by using Me.Line (0, 0)-(.Width, 0) I get lines under every record in
the section. Right now I have tried to draw in a line at the top of the page
footer that would connect to the horizontal borders around the detail section.
The problem is that I have to continually play with the spacing in various
aspects of the report to get this border close to lining up with the
horizontal borders. Can anyone please help with code that would avoid this
problem?

Steel
 
D

Duane Hookom

Do you want a line at the bottom of the last detail section on a page or in
a group? Does the horizontal line have to be at the bottom of the detail
section or can you use a large rectangle drawn in the On Page event?
 
S

Steel via AccessMonster.com

I would like the line to be drawn after the last record in the detail section
that fits onto the first page. By having code to draw a horizontal line in
the report footer, I have the line that I want at the end of the report
(after the last record in the detail section of the report). I just need a
horizontal line that shows the end of the detail section for the first page
(basically the end of the report that fits onto the first page). At this
point I have used code to draw lines that border the group header, detail
section, and report footer to get at drawing a box that encompasses these
sections. I figured this would be easier because my reports are multiple
pages and vary in size from the first to second page. If there is a code to
draw a rectangle without putting separate codes in for each section and for
each horizontal/vertical line this could simplify what I am trying to do.
However, since most of my reports are multiple pages which differ in size
from the first to second page would this mean that I need to put separate
codes in for each page to fit the varying sizes?

Thanks for the reply

Steel

Duane said:
Do you want a line at the bottom of the last detail section on a page or in
a group? Does the horizontal line have to be at the bottom of the detail
section or can you use a large rectangle drawn in the On Page event?
I currently have a multiple page report that I created that I have placed
horizontal lines within. However, I cannot seem to figure out how to
[quoted text clipped - 23 lines]
 
D

Duane Hookom

You can use the Top property of the detail section to kinda determine when
you are close enough to the bottom of the page that another record won't
fit. This code worked for me

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)
If Me.Top > 14000 Then
Me.DrawWidth = 10
Me.ForeColor = vbRed
Me.Line (0, Me.Height)-Step(Me.Width, 0)
End If
End Sub


--
Duane Hookom
MS Access MVP
--

Steel via AccessMonster.com said:
I would like the line to be drawn after the last record in the detail
section
that fits onto the first page. By having code to draw a horizontal line
in
the report footer, I have the line that I want at the end of the report
(after the last record in the detail section of the report). I just need
a
horizontal line that shows the end of the detail section for the first
page
(basically the end of the report that fits onto the first page). At this
point I have used code to draw lines that border the group header, detail
section, and report footer to get at drawing a box that encompasses these
sections. I figured this would be easier because my reports are multiple
pages and vary in size from the first to second page. If there is a code
to
draw a rectangle without putting separate codes in for each section and
for
each horizontal/vertical line this could simplify what I am trying to do.
However, since most of my reports are multiple pages which differ in size
from the first to second page would this mean that I need to put separate
codes in for each page to fit the varying sizes?

Thanks for the reply

Steel

Duane said:
Do you want a line at the bottom of the last detail section on a page or
in
a group? Does the horizontal line have to be at the bottom of the detail
section or can you use a large rectangle drawn in the On Page event?
I currently have a multiple page report that I created that I have placed
horizontal lines within. However, I cannot seem to figure out how to
[quoted text clipped - 23 lines]
 
S

Steel via AccessMonster.com

Duane,

I tried the code you gave me and it did insert a red line at the bottom of
the detail but it inserted more than one. I tried changing the number but
was unable to only get one line at the bottome of the detail........either I
got none or more than one. Any suggestions or thoughts on what this problem
may be?

Thanks again.

Steel

Duane said:
You can use the Top property of the detail section to kinda determine when
you are close enough to the bottom of the page that another record won't
fit. This code worked for me

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)
If Me.Top > 14000 Then
Me.DrawWidth = 10
Me.ForeColor = vbRed
Me.Line (0, Me.Height)-Step(Me.Width, 0)
End If
End Sub
I would like the line to be drawn after the last record in the detail
section
[quoted text clipped - 32 lines]
 
S

Steel via AccessMonster.com

Duane,

I just tried changing the drawing width to 1 and changed the number several
times and was able to get it to work the way I wanted.

Thanks for all of the help.

Steel
Duane,

I tried the code you gave me and it did insert a red line at the bottom of
the detail but it inserted more than one. I tried changing the number but
was unable to only get one line at the bottome of the detail........either I
got none or more than one. Any suggestions or thoughts on what this problem
may be?

Thanks again.

Steel
You can use the Top property of the detail section to kinda determine when
you are close enough to the bottom of the page that another record won't
[quoted text clipped - 13 lines]
 

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