Results 1 to 4 of 4
  1. #1
    SeniorCitizen is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    32

    Address printing


    In a three line address is there a way to move the third line to the second line if the second line is blank and blank out the original third line. This would leave no blank line in the two line addresses?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Could try using concatenation with a mix of + and & characters.

    + sign causes concatenation with string and Null to return Null.
    & sign causes concatenation with string and Null to return string.

    F1 & Chr(13) & Chr(10) & (F2 + Chr(13) + Chr(10)) & F3

    Or a VBA custom function to return concatenated string.

    Or set 3 textboxes to AllowShrink and AllowGrow to yes. Set their height to 0 and position them up against each other.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi
    You can use the following in an Unbound Textbox:-

    =([Companyname]& Chr(13) & Chr(10)) &
    ([Address1]+Chr(13)+Chr(10)) &
    ([Address2]+Chr(13)+Chr(10)) &
    ([Address3]+Chr(13)+Chr(10)) &
    ([Town]+Chr(13)+Chr(10)) &
    ([PostCode]+Chr(13)+Chr(10)) & [Country]
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    I use this for mailing addresses

    Code:
    Function MailingAddress(Optional St As Variant = Null, Optional Cty As Variant = Null, Optional State As Variant = Null, Optional Zip As Variant = Null, Optional Apt As Variant = Null) As Variant
    
    
        MailingAddress = (St + vbNewLine) & ("Apt " + Apt + vbNewLine) & (Cty + ", ") & (State + " ") & Zip
    
    
    End Function
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

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

Similar Threads

  1. Replies: 4
    Last Post: 05-12-2021, 06:20 AM
  2. Printing Address and Content in a word Document
    By gaby58 in forum Programming
    Replies: 3
    Last Post: 03-29-2019, 01:22 PM
  3. Replies: 4
    Last Post: 01-06-2018, 03:26 PM
  4. Replies: 7
    Last Post: 06-27-2016, 12:28 PM
  5. Replies: 2
    Last Post: 08-22-2013, 12:02 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