Results 1 to 6 of 6
  1. #1
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63

    Add blank lines to report to printed report

    Hi,
    I have a report based on a query that prints out a list of addresses. I will be handing hard copies of this report out to various people and I want them to be able to handwrite more information on blank lines below the query results. The number of query results may vary each time I print the report but I want the blank lines to continue only to the bottom of the page regardless. I don't want the blank lines to reflect actual blank entries in the query or its table though.
    I borrowed a bit of code from somewhere online and have the basic idea working. My question now though is, how do I set the formatting of these lines to match the query generated lines above them? Right now they are just basic black lines, but I'd like to make them alternating white and shaded fields. Here is what I have right now:


    Code:
    Private LinePos As Long
    Option Compare Database
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
         LinePos = Me.Top + 1.3 * Me.Section(0).Height
    End Sub
    
    Private Sub Report_Page()
        For LinePos = LinePos To 7.5 * 1440 _
                                            Step Me.Section(0).Height
             Me.Line (0, LinePos)-(Me.Width, LinePos)
        Next LinePos
    End Sub
    I appreciate any help you can give me.
    Last edited by Jaron; 06-13-2013 at 10:36 AM.

  2. #2
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Here's a page with the properties in Access of the Line method of the Report object
    http://msdn.microsoft.com/en-us/libr...ffice.14).aspx

    Apparently, the format of the call is

    expression.Line(Step(x1, y1) – Step(x2, y2), color, BF)

    Look at that page, and figure out what you need to do to set (or toggle) that BF (background/foreground) parameter.

  3. #3
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63
    Quote Originally Posted by Dal Jeanis View Post
    Here's a page with the properties in Access of the Line method of the Report object
    http://msdn.microsoft.com/en-us/libr...ffice.14).aspx

    Apparently, the format of the call is

    expression.Line(Step(x1, y1) – Step(x2, y2), color, BF)

    Look at that page, and figure out what you need to do to set (or toggle) that BF (background/foreground) parameter.
    Ok. I'll spend some time with that and see if I can figure it out. I'm new to Access reports as I've been using Excel for a lot of things, so if you have any suggestions on how to use this information to modify the code I've already got, please let me know.

    Thank you.

  4. #4
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    My use of reports is pretty basic. Play with this until you get what you want.
    Code:
    Private Sub Report_Page()
    Dim bolWhite as Boolean
    Dim LineBot AS Long
    Dim colGrey AS Long
    Const BoxPercent = 0.95
        
        bolWhite = False
        colgrey = RGB(200,200,200)
    
        For LinePos = LinePos To 7.5 * 1440 _
                                            Step Me.Section(0).Height
    
             LineBot = LinePos + (BoxPercent * Me.Section(0).Height)
             bolWhite = Not (bolWhite)            
             If bolWhite Then 
                 Me.Line (0, LinePos)-(Me.Width, LinePos)
             Else
                 Me.Line (0, LinePos)-(Me.Width, LineBot), colGrey, BF
             End If
        Next LinePos
    
    End Sub
    bolWhite will alternate between true and false, turning dark or light by turns.
    colgrey you can adjust until the color of the dark boxes is what you want.
    Boxpercent can be adjusted if needed, to resize the dark area.

  5. #5
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63
    Quote Originally Posted by Dal Jeanis View Post
    My use of reports is pretty basic. Play with this until you get what you want.
    Code:
    Private Sub Report_Page()
    Dim bolWhite as Boolean
    Dim LineBot AS Long
    Dim colGrey AS Long
    Const BoxPercent = 0.95
        
        bolWhite = False
        colgrey = RGB(200,200,200)
    
        For LinePos = LinePos To 7.5 * 1440 _
                                            Step Me.Section(0).Height
    
             LineBot = LinePos + (BoxPercent * Me.Section(0).Height)
             bolWhite = Not (bolWhite)            
             If bolWhite Then 
                 Me.Line (0, LinePos)-(Me.Width, LinePos)
             Else
                 Me.Line (0, LinePos)-(Me.Width, LineBot), colGrey, BF
             End If
        Next LinePos
    
    End Sub
    bolWhite will alternate between true and false, turning dark or light by turns.
    colgrey you can adjust until the color of the dark boxes is what you want.
    Boxpercent can be adjusted if needed, to resize the dark area.
    Thank you! That's what I needed. I've tweaked the numbers a little and I believe it's where I want it. I appreciate the help.

  6. #6
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    You're welcome. Please mark thread "solved". top of page, under "thread options"

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

Similar Threads

  1. Replies: 3
    Last Post: 05-13-2013, 07:06 PM
  2. Hide button on printed report
    By tylerg11 in forum Reports
    Replies: 5
    Last Post: 12-03-2012, 03:20 PM
  3. Replies: 1
    Last Post: 03-22-2012, 07:14 PM
  4. Replies: 1
    Last Post: 08-25-2011, 06:50 PM
  5. Report printing unknown blank lines.
    By dgrzalja in forum Reports
    Replies: 10
    Last Post: 11-02-2009, 12:21 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