Hey folks,
This is a very simple problem that has been bothering for a few days now. It's due to the old "vertical lines can't grow" problem.
I have two horizontal lines with text boxes inbetween them which are "Can Grow = yes". I want one vertical line to separate the two boxes, ie drawn vertically exactly between the two horizontal lines.
Line1------|------
Text1 | Text2
Line2------|------
I am, as recommended by may other expert, doing this using the On_Print command. VB doesnt seem to like me drawing from the two Line.Top properties.
Here's my code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Comment: Draws a vertical line that will resize.
' Declarations
Dim X1 As Single 'Start of line
Dim Y1 As Single
Dim X2 As Single 'End of line
Dim Y2 As Single
Dim Color As Long
' Set measurement to cms, line width in pixels, black line color, .
Me.ScaleMode = 7
Me.DrawWidth = 5
Color = RGB(0, 0, 0)
Y1 = Me.Line1.Top '***Is this the right syntax????
Y2 = Me.Line2.Top
X1 = 9 '9 = roughly the center of the page
X2 = 9
'Finally draw the line
Me.Line (X1, Y1)-(X2, Y2), Color
End Sub
This code works ok if the two Y values are set at, say, 5 and 6.
Any ideas????
Thanks in advance,
Flarkey in Belfast
This is a very simple problem that has been bothering for a few days now. It's due to the old "vertical lines can't grow" problem.
I have two horizontal lines with text boxes inbetween them which are "Can Grow = yes". I want one vertical line to separate the two boxes, ie drawn vertically exactly between the two horizontal lines.
Line1------|------
Text1 | Text2
Line2------|------
I am, as recommended by may other expert, doing this using the On_Print command. VB doesnt seem to like me drawing from the two Line.Top properties.
Here's my code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Comment: Draws a vertical line that will resize.
' Declarations
Dim X1 As Single 'Start of line
Dim Y1 As Single
Dim X2 As Single 'End of line
Dim Y2 As Single
Dim Color As Long
' Set measurement to cms, line width in pixels, black line color, .
Me.ScaleMode = 7
Me.DrawWidth = 5
Color = RGB(0, 0, 0)
Y1 = Me.Line1.Top '***Is this the right syntax????
Y2 = Me.Line2.Top
X1 = 9 '9 = roughly the center of the page
X2 = 9
'Finally draw the line
Me.Line (X1, Y1)-(X2, Y2), Color
End Sub
This code works ok if the two Y values are set at, say, 5 and 6.
Any ideas????
Thanks in advance,
Flarkey in Belfast