Results 1 to 9 of 9
  1. #1
    tkosel is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    23

    Grow a report section line issue

    I have a report with several groupings. The group section Header can grow property is set to true as well as several fields in each group section.



    I want to have a vertical line on both the left and right side of each group to make the report easier to read. I have searched for methods to do this, but cannot get any of them to work properly.

    The simplest method I have found involves setting the Group Header Section Special Effect to Sunken. This sort of works, but not on the right side of the section. I also don't like the horizontal lines this causes. I wish I could find some code that works that uses the Line method to create these vertical lines. Can anyone Help? Either with making the right side special effect to work, or with use of the line method to make it work.

    Click image for larger version. 

Name:	Capture.jpg 
Views:	13 
Size:	245.8 KB 
ID:	44425

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,246
    Have you tried this solution?
    https://www.itsupportguides.com/know...elds-can-grow/
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    tkosel is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    23
    Yes, it doesn't work. I tried it in the group header section for the section below with the text "Preventative Maintenance Record Task Info." Note the line didn't grow like the other controls did. Perhaps it will only work in a detail section?

    Click image for larger version. 

Name:	Capture.jpg 
Views:	13 
Size:	122.6 KB 
ID:	44426

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,246
    But you did adapt it for your needs right, like putting the code in the GroupHeader Print event, not in the Detail_Print one?

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    tkosel is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    23
    Yes, I put the code in my Groupheader Print event, which is named "TaskIDHeader ", and changed the code as illustrated below. I left the line name at "Line83". Doesn't work.

    Private Sub TaskIDHeader_Print(Cancel As Integer, PrintCount As Integer)

    Dim CtlDetail As Control
    Dim intLineMargin As Integer
    intLineMargin = 0

    For Each CtlDetail In Me.Section(acTaskIDHeader).Controls

    With CtlDetail

    If CtlDetail.Name = "line83" Then

    Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + intLineMargin, Me.Height)

    End If

    End With

    Next

    Set CtlDetail = Nothing

    End Sub

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,246
    And you are looking at the report in Print Preview or actually print it? The Print event does not fire in report view:
    https://www.engram9.info/access-2007...of-events.html
    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    tkosel is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2014
    Posts
    23
    I am looking at it in print preview. It also does not work when I actually print it to a printer.

  8. #8
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    506
    Try:
    Code:
    Private Sub TaskIDHeader_Print(Cancel As Integer, PrintCount As Integer)
        Me.Line (0, 0)-(0, Me.Height)
        Me.Line (Me.Width, 0)-(Me.Width, Me.Height)
    End Sub
    BTW, what is acTaskIDHeader?

    Cheers,
    John

  9. #9
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,246
    Please have a look at the attached file. Make sure you place the code in the right section (usually GroupHeader0).
    Cheers
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-17-2018, 09:31 AM
  2. Vertical Line grows when when fields grow
    By trident in forum Reports
    Replies: 4
    Last Post: 04-28-2016, 02:25 AM
  3. Replies: 12
    Last Post: 01-12-2016, 08:53 PM
  4. Can Grow Issue
    By mblevins in forum Forms
    Replies: 5
    Last Post: 11-08-2013, 07:52 AM
  5. Replies: 6
    Last Post: 03-26-2013, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums