Results 1 to 14 of 14
  1. #1
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389

    How to draw page border in report.


    I have prepared a report which has page header and page footer and also report header and report footer. I want the page border to be printed on each page in the report but I am not able to understand how this page border will be drawn. I googled a lot about this but can't understand.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    See this link
    https://learn.microsoft.com/en-us/of...ss.Report.Line

    and Google ‘access vba report line’ for more links

  3. #3
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by CJ_London View Post
    See this link
    https://learn.microsoft.com/en-us/of...ss.Report.Line

    and Google ‘access vba report line’ for more links
    it requires coding?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You can spend an hour getting vertical and horizontal lines in the report sections to line up and be the right lengths, or it can be as simple as one line of code in the sub:
    Code:
    Private Sub Report_Page()
       Me.Line (0,0)-(Me.ScaleWidth - 40, Me.ScaleHeight),, B
    End Sub
    You can play with the 40 value to get the right side looking the way you want it. Without subtracting some number, the line will probably be hidden by the page margin, so it depends on your margin settings. If you want colour in the line then add that as shown in the example.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Micron View Post
    You can spend an hour getting vertical and horizontal lines in the report sections to line up and be the right lengths, or it can be as simple as one line of code in the sub:
    Code:
    Private Sub Report_Page()
       Me.Line (0,0)-(Me.ScaleWidth - 40, Me.ScaleHeight),, B
    End Sub
    You can play with the 40 value to get the right side looking the way you want it. Without subtracting some number, the line will probably be hidden by the page margin, so it depends on your margin settings. If you want colour in the line then add that as shown in the example.
    thnaks... it work

  6. #6
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Micron View Post
    You can spend an hour getting vertical and horizontal lines in the report sections to line up and be the right lengths, or it can be as simple as one line of code in the sub:
    Code:
    Private Sub Report_Page()
       Me.Line (0,0)-(Me.ScaleWidth - 40, Me.ScaleHeight),, B
    End Sub
    You can play with the 40 value to get the right side looking the way you want it. Without subtracting some number, the line will probably be hidden by the page margin, so it depends on your margin settings. If you want colour in the line then add that as shown in the example.
    how can i increase the thickness of the line in this code. i tried many things and even googled but failed every time.
    like this
    Me.Line (1,1)-(Me.ScaleWidth - 40, Me.ScaleHeight),, B

    and

    Me.Line (0,0)-(Me.ScaleWidth - 80, Me.ScaleHeight),, B

  7. #7
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Your google skills appear to need a little training.

    https://learn.microsoft.com/en-us/of...ne.borderwidth
    https://learn.microsoft.com/en-us/of...ess.line.width

    The setting you are changing has nothing to do with the line width
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I might be wrong but to me, those links refer to line controls and control border thickness.
    @deepaksharma; Maybe it's just me, but I'm growing weary of feeding you links and reading your follow up posts that indicate you do not carefully read what you're given, be that in a reply in your thread or a link you are given. From the link given about a report border:

    The width of the line drawn depends on the DrawWidth property setting.

    I have never done this so I can't help implement it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Micron View Post
    I might be wrong but to me, those links refer to line controls and control border thickness.
    thank you micron this code work

    Private Sub Report_Page()

    Me.Report.DrawWidth = 5
    Me.Line (0, 0)-(Me.ScaleWidth - 40, Me.ScaleHeight), , B

    end sub

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Glad to see that! Thanks for the rep points. Surely my salary here will be doubled soon.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by Micron View Post
    Surely my salary here will be doubled soon.
    There's a queue...
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  12. #12
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    thanks to all..................

  13. #13
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    There's a queue...
    Yes, and it's based on post count! I can almost see you way back there.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  14. #14
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by Micron View Post
    Yes, and it's based on post count! I can almost see you way back there.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Border Color Formatting in a Report
    By jlindquist23 in forum Reports
    Replies: 2
    Last Post: 05-12-2020, 01:59 PM
  2. Replies: 0
    Last Post: 04-15-2016, 08:08 AM
  3. Replies: 2
    Last Post: 02-04-2016, 08:13 AM
  4. Replies: 3
    Last Post: 12-22-2015, 03:23 AM
  5. Border surrounding entire Report
    By yes sir in forum Access
    Replies: 1
    Last Post: 11-13-2010, 01:58 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