Vertical line between columns, full page length

  • Thread starter Thread starter Sunrise
  • Start date Start date
S

Sunrise

I have a two-column report and would like to have one solid line between the
two columns.

I've tried adding a line in Design View but this only has the effect of
depositing a portion of a line beside each record. I'm looking for one long
continuous vertical line.

Any ideas?
 
I have a two-column report and would like to have one solid line between the
two columns.

I've tried adding a line in Design View but this only has the effect of
depositing a portion of a line beside each record. I'm looking for one long
continuous vertical line.

Any ideas?

Look up the Line Method in VBA help.

Place the code below in the report's Page event.
Note: you may have to adjust the length of the line below.

Private Sub Report_Page()
Dim X1, Y1, X2, Y2 As Single
Me.DrawStyle = 0 ' a solid line

Me.DrawWidth = 1 ' set the thickness of the line

' Set the coordinates and draw a line down the middle of the page.

X1 = Int(Me.ScaleWidth / 2) ' find the middle of the page
Y1 = Me.Section(3).Height ' start just below the page header
X2 = X1 ' the line is vertical

' length of line is the length of the Page - (Height of the Page
' Header + Height of the Page Footer).

Y2 = Me.ScaleHeight - (Me.Section(1).Height + Me.Section(4).Height)

Me.Line (X1, Y1)-(X2, Y2) ' This draws the line

End Sub
 
Thank you Fred. I'm just getting familiar with VBA so this will be a
challenge. Really appreciate your help.
 
Back
Top