kec
Registered User.
- Local time
- Today, 01:58
- Joined
- Jan 21, 2005
- Messages
- 17
This code comes from Stephen Lebans, http://www.lebans.com/Report.htm
This code draws lines around each field in the report detail and expands with the text.
-Ken
This code draws lines around each field in the report detail and expands with the text.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer
' Stephen Lebans 1999
' Stephen@ lebans.com
' www.lebans.com
' This is the spacing between the right edge of the
' control and the Vertical Seperation Line
intLineMargin = 0
' OK lets draw a vertical line to seperate each field
' for each control in details control
' If your last control on the right does not end on the edge of the section
' you will get a second vertical line. If you need to get around this then you
' can skip drawing this last Vertical Seperation Line in a couple of ways.
' We'll use the control name method Here. Our right most control is named
' TestMemo. IF current control is TestMemo - Do not print Vertical Line
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
'If CtlDetail.name <> "TestMemo" Then
Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + _
intLineMargin, Me.Height)
'End If
End With
Next
'While we are here lets draw a box around the Detail section
With Me
Me.Line (0, 0)-Step(.Width, .Height), 0, B
End With
Set CtlDetail = Nothing
End Sub
-Ken
Last edited: