Draw expanding lines in report detail (1 Viewer)

Status
Not open for further replies.

kec

Registered User.
Local time
Yesterday, 22:11
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.

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:

skea

Registered User.
Local time
Today, 08:11
Joined
Dec 21, 2004
Messages
342
Thanks Kec....Ken:cool:
 

kec

Registered User.
Local time
Yesterday, 22:11
Joined
Jan 21, 2005
Messages
17
No problem skea.

I just wish I could remember where I got the code from so I could give credit where credit is due.

-Ken
 

kec

Registered User.
Local time
Yesterday, 22:11
Joined
Jan 21, 2005
Messages
17
Thanks Rak!

For the life of me I couldn't find the author of the code - and I had looked through Stephen's code, but missed it.

-Ken
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom