Results 1 to 9 of 9
  1. #1
    Phyllis622 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    10

    Question Removing an address field when it contains no data in a report

    I created a report to print out a letter that will be sent to all of our clients. In the address section of the letter there are two field for adresses...Address1 and Address2. One is for a street address and the other for a PO Box. Not all of the clients have a PO Box and for these, I do not want the blank line to show in the address. For example:
    John Doe
    3 Main Street

    Franklin, MA 02038

    The field and section of the report are set to "can shrink" and "can grow", but it still gives me a blank line in the address for the clients that do not have a PO Box. What else do I have to do?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Are there any other controls to the left or right of the address fields on the report? These can prevent CanShrink from behaving as expected.

  3. #3
    Phyllis622 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    10
    No nothing to the left or right. This is what it looks like:

    =[FirstName]&" "&[LastName]
    Address1
    Address2
    =[City]&", "&[State]&" "&[PostalCode]

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Try using + signs instead of &
    I think it will remove the "empty" address2

  5. #5
    Phyllis622 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    10
    Thanks, I tried the + signs, but it didn't work.

  6. #6
    Phyllis622 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    10
    Thank you for the input. I'm not familiar with the expression you are suggesting, can you show me what it would look like? Can I do a TRIM somehow?

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I found this just now


    Using + to concatenate the strings will result in a Null value rather than a
    space when needed. For instance,

    (StreetNumber + " ") & StreetName

    will not have a leading space, since Null + " " = Null
    After the parenthesis, the result of the Addition will be Null & StreetName,
    which concatenates as you are used to.


    here

  8. #8
    Phyllis622 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    10
    Right, but can I use this when Address1 and Address2 need to be on separate lines in the report?

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

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

Similar Threads

  1. Replies: 1
    Last Post: 11-25-2014, 04:44 AM
  2. Replies: 2
    Last Post: 08-22-2013, 12:02 AM
  3. Replies: 1
    Last Post: 08-31-2012, 01:47 PM
  4. Replies: 4
    Last Post: 04-14-2012, 07:22 PM
  5. Emailing report to address held in field
    By ham355 in forum Reports
    Replies: 4
    Last Post: 02-21-2012, 01:07 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