Results 1 to 2 of 2
  1. #1
    lewis1682 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Aug 2013
    Posts
    37

    Removing Text If Null

    I have some address labels set out in the following way.
    Title FirstName LastName
    JobTitle
    Company
    AddressLine1
    AddressLine2
    Town


    County
    PostalCode

    How can I create this so if some field is left blank then that field is deleted and everthing moved up one. For example: if JobTitle and Company were blank I would want them to be deleted and the fields below them to move up so no spaces are left if it is null. Do you understand me?

    Thank you for your help.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I do this in the format event of the appropriate section:

    Code:
      Me.txtName = (CustAttn + vbCrLf) _
                 & (CustomerName + vbCrLf) _
                 & (CustomerAddress1 + vbCrLf) _
                 & (CustAddress2 + vbCrLf) _
                 & (CustAddress3 + vbCrLf) _
                 & (CustAddress4 + vbCrLf)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Removing text between parentheses.
    By jwhitley in forum Programming
    Replies: 3
    Last Post: 01-17-2013, 02:37 PM
  2. VBA to update to predefined text where is null
    By webisti in forum Programming
    Replies: 1
    Last Post: 12-05-2012, 02:13 PM
  3. how to deal with null time value in text box
    By RedGoneWILD in forum Programming
    Replies: 5
    Last Post: 06-28-2012, 06:56 PM
  4. Replies: 21
    Last Post: 05-20-2012, 02:15 PM
  5. Replies: 5
    Last Post: 02-10-2010, 12:27 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