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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wanted: Single Black line between rows

Status
Not open for further replies.

rccline

Technical User
Jun 13, 2002
341
US
Under the title "Line Method," Microsoft Visual Basic help gives the following code example of On Format Event, for Reports.

The example works, but produces a double line between records. How do you change the report to show a single line between records on the report?

Thanks

Robert

Code:
Sub DrawLine()
    Dim rpt As Report, lngColor As Long
    Dim sngTop As Single, sngLeft As Single
    Dim sngWidth As Single, sngHeight As Single

    Set rpt = Reports![rptOption_Lines]
    ' Set scale to pixels.
    rpt.ScaleMode = 3
    ' Top inside edge.
    sngTop = rpt.ScaleTop + 5
    ' Left inside edge.
    sngLeft = rpt.ScaleLeft + 5
    ' Width inside edge.
    sngWidth = rpt.ScaleWidth - 10
    ' Height inside edge.
    sngHeight = rpt.ScaleHeight - 10
    ' Make color red.
    lngColor = RGB(255, 0, 0)
    ' Draw line as a box.
    rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B
End Sub
 
Yes. The above code produces "double lines" between each record on the report. I would like to see a single line separating records.

Robert
 
I just fiddled with the calculations; leave ScaleTop and ScaleHeight without adjustment and see how that works for you:

rpt.ScaleMode = 3
' Top inside edge.
sngTop = rpt.ScaleTop
' Left inside edge.
sngLeft = rpt.ScaleLeft + 5
' Width inside edge.
sngWidth = rpt.ScaleWidth - 10
' Height inside edge.
sngHeight = rpt.ScaleHeight
' Make color red.
lngColor = RGB(255, 0, 0)
' Draw line as a box.
rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B


Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top