ChoonBoy said:
I had alot of help from my earlier posting on Horizontal Line from Marshall
Barton which I am truely grateful.
The issue now is Vertical Line:
I managed to get the code below from Access Report help. The code will draw
vertical lines in relation to textbox growth and for multiple records.
Me.ScaleMode = 1
Me.ForeColor = 0
Me.Line (0 * 1440, 0)-(0.08 * 1440, 14400) 'Draws line at Left Margin
Me.Line (1.04 * 1440, 0)-(1.04 * 1440, 14400) 'At 1 inch
The Problem:
How do I improve on the above code to draw a Veritcal Fixed-height line.
This line should always be drawn whether there is one item in the list or
many.
If you were using A97 or A2007, I would tell you to RTFM
before asking such a question. Unfortunately, the Help
topic for the Line, Circle and PSet methods is garbled in
versions A2000 through A2003 so I can't do that. Instead,
here's a copy of the A97 Help topic:
object.Line [[Step](x1, y1)]–[Step](x2, y2)[,[color][,B[F]]]
You can use this method only in an event procedure or a
macro specified by the OnPrint or OnFormat event property
for a report section, or the OnPage event property for a
report.
The Line method has the following arguments.
Argument Description
object The Report object on which the line or
rectangle is to be drawn.
Step A keyword that indicates the starting point
coordinates are relative to the current graphics
position given by the settings for the CurrentX
and CurrentY properties of the object argument.
x1, y1 Single values indicating the coordinates of the
starting point for the line or rectangle. The
Scale properties (ScaleMode, ScaleLeft,
ScaleTop, ScaleHeight, and ScaleWidth) of the
Report object specified by the object argument
determine the unit of measure used. If this
argument is omitted, the line begins at the
position indicated by the CurrentX and CurrentY
properties.
Step A keyword that indicates the end-point
coordinates are relative to the line's starting
point.
x2, y2 Single values indicating the coordinates of the
end point for the line to draw. These arguments
are required.
color A Long value indicating the RGB (red-green-blue)
color used to draw the line. If this argument is
omitted, the value of the ForeColor property is
used. You can also use the RGB function or
QBColor function to specify the color.
B An option that creates a rectangle by using the
coordinates as opposite corners of the
rectangle.
F F cannot be used without B. If the B option is
used, the F option specifies that the rectangle
is filled with the same color used to draw the
rectangle. If B is used without F, the rectangle
is filled with the color specified by the
current settings of the FillColor and BackStyle
properties. The default value for the BackStyle
property is Normal for rectangles and lines.
Now to your question.
For a vertical line, you can use the syntax:
Me.Line (X1,Y1)-(X2,Y2)
A vertical line is any line where X1 and X2 are equal (note
that your left margin line is not quite vertical). The
height of the line will be Y2 - Y1.
Or you can use the syntax:
Me.Line (X1,Y1)-Step(0,height)
Based on all that stuff, the trick is to specify the
coordinates of the line's end points. I can not do that for
you unless you can describe them in sufficient detail and if
you can do that, you might not even need to ask the
question. I suggest that you try to describe where the top
and bottom of the line are in relation to one or two text
boxes or maybe within the report section and I'll try to
come up with an expression for the coordinates.