I have a report in which I use vertical lines to separate values. However, there are data fields which need to grow, while others do not (some data fields require two lines while other only need one). Since that caused the lines to break where two rows were required, I added the code below to fix the problem. Here's the problem ... it only works when printed (or print-previewed). I need to distributed these reports in a PDF format, and this code does not work in that format. I'm thinking the existing code just needs some modifications, but I don't know where to start.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer
intLineMargin = 0
For Each CtlDetail In Me.Section(asDetail).Controls
With CtlDetail
If CtlDetail.Name = "Line155" Then
Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + _
intLineMargin, Me.Height)
End If
End With
Next
Set CtlDetail = Nothing
End Sub
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer
intLineMargin = 0
For Each CtlDetail In Me.Section(asDetail).Controls
With CtlDetail
If CtlDetail.Name = "Line155" Then
Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + _
intLineMargin, Me.Height)
End If
End With
Next
Set CtlDetail = Nothing
End Sub