Draw a vertical line

J

JOM

A part of my report looks like this
_________________________________________________________
John smith |
123 Address line 1 |
P.O Box Address line 2 |
Las Vegas, NE 14785 - 0000 |
_______________________________|___________________________

The following draws my vertical line where I want it to draw. But sometimes
the address line 2 does not exist so that means the vertical line will be
longer than needed how do I format the report so that If I have 1 or 2
address lines the vertical line will be propotional to the report....


Sub DrawLine()

Dim lngColor As Long
Dim sngHeight As Single


' Set scale to twips
Me.ScaleMode = 1
' Set line width in pixels
Me.DrawWidth = 5
' Set height to artificially high value
sngHeight = 1980
' Make colour black
lngColor = RGB(0, 0, 0)
' Draw line 3.86 inches in from left margin
Me.Line (5572, 50)-(5572, sngHeight), lngColor End Sub
 
K

KARL DEWEY

Open the report in design view, click on the tool box and Line. position the
line where you want it. I have not gotten a line to grow. You might try a
solid line border for your object.
 
J

JOM

Karl, thanks for the response, however that is not what I was looking for....
My line is drawn by code, I have a post "Empty line in a report" That Ken
helped me alot. the part that I got stuck was the setting of the value of
the sngHeight variable in the detail section's Format section so that it
varies depending on whether the second address line is Null or not.
 

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