I know diddly about VB. I found the below sample code that appears to do what I need. I need to draw a rectangle around a report detail section and page footer. It does do it, but I'm having issues trying to modify.
How should I be using the DrawWidth property to set the rectangle line width? I'm looking to set it a 2 pts, but would like finer control if possible.
Please explain this...
sngTop = rpt.ScaleTop + 0 seems to do nothing to set the top location of the rectangle, and appears to be adjusting the left side.
sngLeft = rpt.ScaleLeft + 2 seems to be setting the top dimension of the rectangle and nothing to do with the left location
What am I missing?
Code:
Private Sub Report_Page()
Dim rpt As Report, lngColor As Long
Dim sngTop As Single, sngLeft As Single
Dim sngWidth As Single, sngHeight As Single
Dim sngLineThickness As Single
Set rpt = Reports!ReportName
' Set scale to 0 for pixels, 5 for inches
rpt.ScaleMode = 5
' Top inside edge.
sngTop = rpt.ScaleTop + 0
' Left inside edge.
sngLeft = rpt.ScaleLeft + 2
' Width inside edge.
sngWidth = rpt.ScaleWidth + 0
' Height inside edge.
sngHeight = rpt.ScaleHeight + 0
' Make color red.
lngColor = RGB(255, 0, 0)
' Set line thickness
sngLineThickness = rpt.DrawWidth + 2
' Draw line as a box.
rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B
End Sub
Thanks!