Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Dec 2000
    Location
    Huntsville AL usa
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    'Growing' a vertical line

    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..

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Edmonton, Alberta, Canada
    Posts
    326
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Growing' a vertical line

    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)

    <hr>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<hr>

  3. #3
    Lounger
    Join Date
    Dec 2000
    Location
    Huntsville AL usa
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: 'Growing' a vertical line

    Wow! That works perfectly :-) Thanks a Million, Douglas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •