Question : Grow Vertical Lines in Access Report

Hi everybody...

I am building a report that has three columns that CanGrow and CanShrink.  I figured out via http://support.microsoft.com/kb/170838 how to create one line, but I am not sure what to do to create three more lines to separate the columns from each other.

How do I add multiple instances of the code in the OnPrint event to accomplish the look of a proper grid?

The code for a single line is as follows:

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 = 5.5
          X2 = 5.5

          ' Set line to print from the top of the detail section
          ' to a maximum height of 22 inches.
          Y1 = 0
          Y2 = 21
          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

End Sub

otamian
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
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 = 5.5
          X2 = 5.5

          ' Set line to print from the top of the detail section
          ' to a maximum height of 22 inches.
          Y1 = 0
          Y2 = 21
          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

End Sub

Answer : Grow Vertical Lines in Access Report

Just use the Line method several times?

(°v°)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

          ' Specify unit of measurement for coordinates on a page...
          Me.ScaleMode = 5 ' Specify that measurement occur in inches.

          Me.DrawWidth = 8 ' Width of the line (in pixels). Note: Some printers do not accept odd numbers.

          ' Draw the lines with the Line method.
          Me.Line (5.5, 0)-(5.5, 21), 0
          Me.Line (7.5, 0)-(7.5, 21), 0
          Me.Line (9.5, 0)-(9.5, 21), 0

End Sub
Random Solutions  
 
programming4us programming4us