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

Line Method Issues

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I,m using the following code to draw a line on a report. Is there a way to adjust the thickness of the line, 1pt 2pt or even just bold the line?

Me.Line (0.13 * 1440, 2500)-(7.7 * 1490, 2500)
 
You can set the DrawWidth property:

[tt] Set rpt = Me
rpt.DrawWidth = 10 'pixels[/tt]
 
Works great! Thanks so much.

Eddy
 
Is there a way to change the point size of the line depending on whether or not it is the last record on as report?
 
Try this:

Code:
Option Compare Database
Dim intCount
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.CurrentRecord = intCount Then
    Me.lnLine.BorderWidth = 2
End If
End Sub

Private Sub Report_Open(Cancel As Integer)
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset(Me.RecordSource)
rs.MoveLast
intCount = rs.RecordCount
rs.Close
End Sub
 
Oops. Forgot the Else:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.CurrentRecord = intCount Then
    Me.lnLine.BorderWidth = 2
Else
    Me.lnLine.BorderWidth = 0
End If
End Sub
 
I'm sorry Remou:

The code you provided works fine, but I was looking for a way to change the DrawWidth of the last record on each page, rather then the report end.

Regards,

And Thanks In Advance....
 
You can check the Report.Top position.

Code:
If Me.Report.Top = 11311 Then 
    Me.lnLine.BorderWidth = 2
Else
    Me.lnLine.BorderWidth = 0
End If
 
I'm sorry Remou:

I have a report where the detail records carry over to the next page. The line drawn at the bottom of each record is "Hairline". For the last record on "Page 1 for instance", what code would I use to make that last record 1pt before carry-ing on to "Page 2".

Regards,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top