Drawing on reports?

M

martinmike2

Hello,

I need to make a report that has lines that run from the top of the
detail section to the bottom of the detail section with no breaks in
it. Just a solid line that extends the length of the page. Is this
possible?
 
A

Allen Browne

martinmike2 said:
I need to make a report that has lines that run from the top of the
detail section to the bottom of the detail section with no breaks in
it. Just a solid line that extends the length of the page. Is this
possible?

Use the Line method in the Page event of the report.

This example draws a red line from the top margin to the bottom margin, at
the left margin:

Private Sub Report_Page()
Me.Line (Me.ScaleTop, Me.ScaleLeft)-(Me.ScaleTop, Me.ScaleHeight), vbRed
End Sub
 
M

martinmike2

Thank You Allen,

So I would replace .scaletop and .scale left with the coordinates i
need the line to start and end at?
 
S

Stockwell43

Hi Martinmike2,

I think I understand. I just tried it and see what you mean about the break.
As far as I can tell, you have to make sure the beginning and end of the line
meets the top and bottom bars of the details section. I had the breaks and
when I ran the line all the way up and all the way down touching the bars the
line was now solid.
 
M

martinmike2

Ok, Allen, yours worked like a champ, but now I am unable to get a
second line .125" to the right. I did the math and figuerd out that .
125: is 180twips.

I tried:
me.line(me.scaletop, 180)-(me.scaletop, me.scaleheight)
me.line(me.scaletop, me.scaleleft +180)-(me.scaletop, me.scaleheight)
me.line(me.scaletop, me.scaleleft -180)-(me.scaletop, me.scaleheight)

all of these just put the line right on top of the left on the margin.

Did i miss something? I read the help documentation and its not all
that helpful, lol. (not surprising)
 
A

Allen Browne

Add 180 twips to the X co-ordinate:

Me.Line (Me.ScaleTop + 180, Me.ScaleLeft) - (Me.ScaleTop + 180,
Me.ScaleHeight), vbGreen
 

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