Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vertical Lines on Report 1

Status
Not open for further replies.

Ray1127

Programmer
Feb 22, 2002
231
US
I have an access 2000 Database with a report. There are 6 fields on the report with 2 of them as Text fields that can contain up to 255 characters of data. I have those 2 fields set to cangrow = Yes. The issue is that if those to fields do expand for the data the vertical lines between each field stay the original length.

I've tried using the Detail_Format Event and the Detail_Print Event to set the height of the vertical lines = the tallest of those 2 fields but in the detail format event it appears that the height is still set at the original and in the Detail_Print event setting the height of the line generates an error. I tried using the sort field for the report and included a group footer and tried setting the height of the vertical line at that point but it generated an error. I don't know what else to try.

Here's the Code as it is now:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim max_height As Long
max_height = 0
'If Me.PROV_GRP.Height > max_height Then max_height = Me.PROV_GRP.Height
If Me.NoteHeader.Height > max_height Then max_height = Me.NoteHeader.Height
If Me.Comments.Height > max_height Then max_height = Me.NoteHeader.Height
'Me.Line12.Height = Me.Height
'Me.Line13.Height = Me.Height
'Me.Line14.Height = Me.Height
'Me.Line15.Height = Me.Height
'Me.Line16.Height = Me.Height
'Me.Line12.Height = Me.Detail.Height
'Me.Line13.Height = Me.Detail.Height
'Me.Line14.Height = Me.Detail.Height
'Me.Line15.Height = Me.Detail.Height
'Me.Line16.Height = Me.Detail.Height

Me.Line12.Height = max_height
Me.Line13.Height = max_height
Me.Line14.Height = max_height
Me.Line15.Height = max_height
Me.Line16.Height = max_height

End Sub


As you can see I've tried several different methods none worked.

any help would be appreciated.
 
You need to use the Line method of the report to draw the lines during the On Print event of the section.

I would make all you vertical lines invisible and set their tag property to "Line". Then use code like:
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim intGrownHeight As Integer
    Dim ctl As Control
    ' find the tallest control and stick its height in intGrownHeight
    intGrownHeight = Me.txtCanGrow.Height
    For Each ctl In Me.Detail.Controls
        If ctl.Tag = "Line" Then
            Me.Line (ctl.Left, ctl.Top)- _
                Step(0, intGrownHeight)
        End If
    Next
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top