Line drawing on report

  • Thread starter Thread starter johnny.graca
  • Start date Start date
J

johnny.graca

Hello,

I tried to draw boxes around text boxes using line method example from internet:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

On Error Resume Next
Dim lngCounter As Long, dblMaxHeight As Double
dblMaxHeight = 0
ReDim strcontrol(3)
strcontrol(0) = "hEv"
strcontrol(1) = "titEvento"
strcontrol(2) = "Assunto"
For lngCounter = 0 To UBound(strcontrol)
If Me(strcontrol(lngCounter)).Height > dblMaxHeight Then dblMaxHeight = Me(strcontrol(lngCounter)).Height
Next
For lngCounter = 0 To UBound(strcontrol)
If lngCounter = 0 Then
Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B
Else
Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B
End If
Next
End Sub

Every thing goes well, but when text boxes have more then 76 characters, the report line corresponding to that record appear with one additional box over the others. I've made some tests and checked that if I clear all the text boxes and labels from the report header the additional box disappear.

Someone could help how can avoid that additional box maintaining the reportheader as I want?

Tks in advance
 
Back
Top