AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Wednesday, December 06, 2006

Gridlines with PrintLine Class

Recently I had to make a report with borders around textboxes in detail section, some kind of invoice report. Some of textboxes have CanGrow property set to True, and in case of long text in one of textboxes - gridlines become looking very ugly. Fortunately I found Stephen Lebans (Access MVP) PrintLine Class, which helped me to make gridlines look nice in a few minutes! Here the code I added to report’s Open Event, it only draw lines in detail section:

Set mPl = New clsPrintLinesV2
mPl.VerticalLines = False
mPl.Border = False
mPl.InitSections Me
mPl.SelectControlsMode = True
 With mPl.plSection(acDetail)
      .VerticalLinesWidth = 10
      .VerticalLines = True
      .VerticalLinesColor = vbBlack
      .VerticalLineMargin = 0
      .BorderWidth = 10
      .Border = True
      .BorderColor = vbBlack
      .RightBorderPosition = Me.Sum.Left + Me.Sum.Width
End With

Thanks Stephen for your code, very cool!

0 Comments:

Post a Comment

<< Home