Results 1 to 5 of 5
  1. #1
    jamil_kwi is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    8

    Access Report

    I made a Report and put borders at detail section's feilds but the problem is if there is more text in one column than the border lines increase with the text length but the other column that has not more text data the border lines are not increased as the the more text data column.



    I also put "Can Grow = Yes " in property of details section. For you reveiw i am attaching the veiw of the report.

    Please help me in this regards,
    ---Jamil

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    I don't think you can force all fields to grow to the same size like you want. . .

    You can try and play with setting the field's height programmatically though: Try playing around with the On Load event of the Report.

  3. #3
    Jim Doherty is offline Novice
    Windows XP Access 2000
    Join Date
    May 2010
    Location
    Derbyshire,England. UK
    Posts
    20
    Quote Originally Posted by jamil_kwi View Post
    I made a Report and put borders at detail section's feilds but the problem is if there is more text in one column than the border lines increase with the text length but the other column that has not more text data the border lines are not increased as the the more text data column.

    I also put "Can Grow = Yes " in property of details section. For you reveiw i am attaching the veiw of the report.

    Please help me in this regards,
    ---Jamil

    The height of each textbox has to be examined to match the height of the tallest and adjustments made set against that value. There is then a 'workaround' element to what you are seeking to achieve using the .Line property of the report as a substitution to the native textbox border. The following should work for you. Replace field name references being passed to the array with the field names on your own report.

    Paste into the Detail_Print event of your report. (I could not read the last field on your .jpg attachment). Make sure the textboxes but up to each other vertically and horizontally.

    Code:
     
    On Error GoTo Err_Detail1_Print
    ReDim strcontrol(4)
        strcontrol(0) = "ITEM"
        strcontrol(1) = "DESCRIPTION"
        strcontrol(2) = "QTY"
        strcontrol(3) = "UNITPRICE"
        strcontrol(4) = "TOTAL"
     
    Dim lngCounter As Long, dblMaxHeight As Double
        dblMaxHeight = 0
    For lngCounter = 0 To UBound(strcontrol)
        If Me(strcontrol(lngCounter)).Height > dblMaxHeight Then dblMaxHeight = Me(strcontrol(lngCounter)).Height
    Next
    For lngCounter = 0 To UBound(strcontrol)
        If lngCounter = 0 Then
            Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B
        Else
            Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B
        End If
    Next
    Exit_Detail1_Print:
        Exit Sub
    Err_Detail1_Print:
        MsgBox Error$, vbInformation, "Detail1_Print Command Cancelled"
        Resume Exit_Detail1_Print
    End Sub

  4. #4
    jamil_kwi is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    8
    Thank you very much for your help.

    It did put the code and its working.

    But i need some more help for the access report. Please have a look in attachment, I need the border only vertical in detail section.

    I really appreciate for your kind help...

    ---Jamil

  5. #5
    Jim Doherty is offline Novice
    Windows XP Access 2000
    Join Date
    May 2010
    Location
    Derbyshire,England. UK
    Posts
    20
    Jamil......learn the Line method and what it does and the effect of co-ordinates and how to use the thing rather than me doing this for you, thats how we all learn. Instead of that last block of code use the following by placing it in the Report_Page event. Add an unbound textbox to the detail section to the left of the ITEM column and set its width property to zero

    Code:
     
    Private Sub Report_Page()
    For Each ctl In Me.Section(acDetail).Controls
    With ctl
    If Page = 1 Then
    
    Me.Line ((.Left + .Width + 0), 1 + Me.Section(acHeader).Height) _ -(.Left + .Width + 0, Me.ScaleHeight - (Me.Section(acPageFooter).Height))
    Else
    Me.Line ((.Left + .Width + 0), 1)-(.Left + .Width + 0, Me.ScaleHeight - (Me.Section(acPageFooter).Height))
    End If End With Next Set ctl = Nothing End Sub
    Last edited by Jim Doherty; 05-30-2010 at 04:45 PM.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-21-2010, 03:57 PM
  2. Access Report
    By gpranjan in forum Reports
    Replies: 0
    Last Post: 12-28-2009, 10:50 AM
  3. Pdf Report Generate from Access
    By ACHU in forum Reports
    Replies: 1
    Last Post: 10-29-2009, 07:49 AM
  4. PDF used in Access Report
    By jsh in forum Forms
    Replies: 2
    Last Post: 04-06-2009, 12:25 PM
  5. Access VBA form/report
    By justaguy in forum Programming
    Replies: 0
    Last Post: 08-18-2008, 09:57 AM

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