Draw a vertical line

G

Guest

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
 
G

Guest

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.
 
G

Guest

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.
 
S

Stephen Lebans

Use the Print event instead of the Format event. Use Me.Height to get the
current Height of the Section.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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

Similar Threads

Invalid use of Me keyword 3
How to draw a vertical line in subreport 3
Empty line in a report 14
VBA looping 1
My earlier post was Horizontal Line 20
Vertical Line Help 2
Vertical Line Issues 2
LineMethod Code 2

Top