Results 1 to 4 of 4
  1. #1
    tigers is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2006
    Posts
    28

    How do I get a line not to print on a report...

    if the line doesn't contain any data? I am printing a list of addresses and sometimes the 2nd line doesn't contain any data because there is no apartment number or suite number. So, in order to save space, I just don't want this line to print if there is nothing to print rather than getting a blank line that takes up space. In the past, I'd use conditional formatting to make the characters white if they were zeros, but they would still take up blank space. This time, I'd like the line to not print. Any ideas? Thanks!

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    You could use the OnFormat event of the Detail section (assuming that is where you are displaying the addresses) to do this. Here is an example:

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    
        If Nz(Me!Addr2, "") = "" Then
            With Me!Addr2
                Me!CityStateZIP.Top = .Top
                .Visible = False
            End With
        Else
            Me!Addr2.Visible = True
            Me!CityStateZIP.Top = 0.9167 * 1440
        End If
        
    End Sub

  3. #3
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    BTW, in VBA the Top property is measured in "twips"; there are 1440 twips to an inch.

  4. #4
    StepUP is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Dec 2005
    Posts
    99
    Another way to do this is to use the MoveLayout, NextRecord, and PrintSection properties in the format event of the detail section.

    Check the Access help for details.

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

Similar Threads

  1. add a print button
    By gromit95 in forum Forms
    Replies: 0
    Last Post: 08-13-2008, 07:28 AM
  2. code to print just first page of a report
    By tonyrice in forum Reports
    Replies: 1
    Last Post: 02-14-2007, 03:07 PM
  3. line skip in bookmarks
    By emilylu3 in forum Programming
    Replies: 0
    Last Post: 03-21-2006, 02:58 PM
  4. Report will not print a bound textbox
    By vvrt in forum Reports
    Replies: 0
    Last Post: 03-16-2006, 02:16 PM
  5. cannot print labels
    By Diane in forum Database Design
    Replies: 4
    Last Post: 12-29-2005, 08:19 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