• ‘Growing’ a vertical line

    Author
    Topic
    #355217

    I am using ACcess 97 Reports. I have vertical lines in the detail section where I also have a ‘can grow’ text box. How can I make the lines longer whenever the box grows?

    I tried to find the new Detail Height and then to extend the vertical lines by using the following code in the ‘On Format’ event of the Detail section:

    txtDetailHeight = txtSynopsis.Height
    linLeftPCRNumDetail.Height = txtDetailHeight

    However, this gave me the un-grown height. I then tried to move this code to the ‘On Print’ event of the Detail section. I got a message that I could not set the Height property after printing was started.

    Does anyone have an idea on how to solve this problem.

    Thanks,

    Dan..

    Viewing 0 reply threads
    Author
    Replies
    • #523513

      To get “stretchy” vertical lines that go the depth of the section, you actually have to draw them yourself. Following is a standard routine I use in my databases that draws a line on top of any existing line whose name starts with “vline”. Note that it must be called in the Print event code of the detail section of the report in order to work correctly. Call it with Call DrawVline(me)

      [indent]


      Public Sub DrawVLine(ByVal Rept As Report) ‘Rept will invariably be Me
      Dim cLine As Control ‘For stepping through every control in the report
      Dim xPos As Single ‘x coordinate of line (in twips)
      Dim yHt As Single ‘y height (in twips)

      For Each cLine In Rept.Controls ‘Step through every control in report
      If cLine.ControlType = acLine And Left(cLine.Name, 5) = “vLine” Then ‘Find all lines named vLine…
      xPos = cLine.Left ‘x position of line
      yHt = Rept.Height ‘height of section
      Rept.Line (xPos, 0)-Step(0, yHt), 0 ‘Draw vertical line at xPos,0 of height yHt in black (colour 0)
      End If
      Next

      End Sub


      [/indent]

      • #523517

        Wow! That works perfectly 🙂 Thanks a Million, Douglas.

    Viewing 0 reply threads
    Reply To: ‘Growing’ a vertical line

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: