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

Horizontal Report Lines Access 2000 1

Status
Not open for further replies.

Arden

Instructor
Aug 24, 2001
31
0
0
CA
I need to have the vertical lines in a report expand and contract when the fields in the detail area expand & contract. I cannot find a property that will control the lines, just the field box.

can anyone give me suggestions on how to do this?
 
You need to set the height property of VERTICAL lines in the ON PRINT event, using the derived / calculated height of the section. Setting it otherwise only uses the static (design value) of the section height. You may be able to implement the following procedure:

Code:
Public Function BasVertLn(Form As String, MyCtrl As String, _
                          Optional LR As Boolean = True) As String

    'Michael Red, 12/1/2001
    'Draw a Vertical Line Beside a Controls on a Report
    'where the control's Properties CanGrow and CanShrink may be TRUE

    Dim X1 As Double        'Left
    Dim Y1 As Double        'Top
    Dim X2 As Double        'Right
    Dim Y2 As Double        'Bottom
    Dim Offset As Long      'Border / Whitspace Width
    Dim LnColor As Double   'Line color to Draw

    Offset = 35

    'Must be CALED from OnPrint Event of Report. Similar to:

    'Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    '    MyCoords = basVarBox(Me.name, Expression.name, False) Lines to RIGHT
    'End Sub

'                               -OR-

    'Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    '    MyCoords = basVarBox(Me.name, Expression.name, True) Lines to LEFT
    'End Sub

    'Where:
    '   MyCoords is a Dummy (String) variable
    '   Me.Name is a constant (returns the Name of the REPORT)
    '   Expression(.Name) is the "name" of the Controls.

    'Left X  (Min of Left of the Control)
    X1 = Reports(Form).Controls(MyCtrl).Left
    X1 = X1 - Offset

    'Right X  (Max of Left + Width of the Controls)
    X2 = Reports(Form).Controls(MyCtrl).Left + Reports(Form).Controls(MyCtrl).Width
    X2 = X2 + Offset

    'Top Y  (Min of Top of the Controls)
    Y1 = Reports(Form).Controls(MyCtrl).Top
    Y1 = Y1 - Offset

    'Bottom Y (Max of Top + Height of the Controls)
    Y2 = Reports(Form).Controls(MyCtrl).Top + Reports(Form).Controls(MyCtrl).height
    Y2 = Y2 + Offset

    Select Case LR

        Case Is = True
            Reports(Form).Line (X1, Y1)-(X1, Y2), LnColor

        Case Is = False
            Reports(Form).Line (X2, Y1)-(X2, Y2), LnColor

    End Select

End Function


MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top