create a vertical line in reports

K

Kitty

can anybody show me how to create a vertical line fm the top margin to the
bottom margin? thx
 
A

Allen Browne

In the Page event procedure of the report, use the Line method.

This example draws a red line from the top margin to the bottom margin, at
the left margin:

Private Sub Report_Page()
Me.Line (Me.ScaleTop, Me.ScaleLeft) - (Me.ScaleTop, Me.ScaleHeight),
vbRed
End Sub
 
M

Mansoor

At last you resolved the problem how to draw a vertical line 10 cm from the
margin. Please be kind and let us know how you did it so we can benefit too.
Mansoor
 
A

Allen Browne

There are 1440 twips to the inch, and 1 inch = 2.54 cm.
10cm in twips is: 1440 * 10/2.54 = 5669

To draw a red line 10 cm from the left margin would be:

Private Sub Report_Page()
Me.Line (Me.ScaleTop + 5669, Me.ScaleLeft) - _
(Me.ScaleTop + 5669, Me.ScaleHeight), vbRed
End Sub
 
M

Mansoor

Thank You, Mr Browne
Mansoor

Allen Browne said:
There are 1440 twips to the inch, and 1 inch = 2.54 cm.
10cm in twips is: 1440 * 10/2.54 = 5669

To draw a red line 10 cm from the left margin would be:

Private Sub Report_Page()
Me.Line (Me.ScaleTop + 5669, Me.ScaleLeft) - _
(Me.ScaleTop + 5669, Me.ScaleHeight), vbRed
End Sub
 
Top