X1 and X2 are the distance from the left edge as you noted. You can redefine them after each line is drawn and draw a new line.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim X1 As Single, Y1 As Single
Dim X2 As Single, Y2 As Single
Dim Color As Long
' Specify unit of measurement for coordinates on a page...
Me.ScaleMode = 5 ' Specify that measurement occur in inches.
' Set line to print 5 inches from the left margin.
X1 = 0.0833
X2 = 0.0833
' Set line to print from the top of the detail section
' to a maximum height of 22 inches.
Y1 = 0
Y2 = 22
Me.DrawWidth = 8 ' Width of the line (in pixels). Note: Some printers do not accept odd numbers.
Color = RGB(0, 0, 0) ' Use black line color.
' Draw the line with the Line method.
Me.Line (X1, Y1)-(X2, Y2), Color
'Second line
X1 = 3
X2 = 3
Me.Line (X1, Y1)-(X2, Y2), Color
'And so on...
End Sub
So this is the script I ended up using, but don't forget for anyone who hasn't done this, the lines will only show up in the print preview and not in the report view.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim X1 As Single, Y1 As Single
Dim X2 As Single, Y2 As Single
Dim Color As Long
' Specify unit of measurement for coordinates on a page...
Me.ScaleMode = 5 ' Specify that measurement occur in inches.
' Set line to print 5 inches from the left margin.
X1 = 0.0833
X2 = 0.0833
' Set line to print from the top of the detail section
' to a maximum height of 22 inches.
Y1 = 0
Y2 = 22
Me.DrawWidth = 8 ' Width of the line (in pixels). Note: Some printers do not accept odd numbers.
Color = RGB(0, 0, 0) ' Use black line color.
' Draw the line with the Line method.
Me.Line (X1, Y1)-(X2, Y2), Color
'Second line
X1 = 4.0417
X2 = 4.0417
Me.Line (X1, Y1)-(X2, Y2), Color
'Third line
X1 = 5.2917
X2 = 5.2917
Me.Line (X1, Y1)-(X2, Y2), Color
'Forth line
X1 = 5.9167
X2 = 5.9167
Me.Line (X1, Y1)-(X2, Y2), Color
'Fifth line
X1 = 6.9167
X2 = 6.9167
Me.Line (X1, Y1)-(X2, Y2), Color
'Sixth line
X1 = 7.9167
X2 = 7.9167
Me.Line (X1, Y1)-(X2, Y2), Color
End Sub
The attached picture shows how it ended up looking. So now I have one more thing I would like to figure out. I know there is an auto format function to center text from left to center to right. Is there a way to center the text from top to center to bottom?.
In other words I would like my values that are displayed in the larger boxes to be centered up with the enlarged box and not at the top.