Results 1 to 3 of 3
  1. #1
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134

    Address transformation VBA --- splitting

    Hi there,

    I am getting a lot addresses with c/o at the end of them.

    However I need to split them. For example: Main Street 24 c/o John Smith should be like this:



    Column1-->Address: Main Street 24 c/o John Smith
    Column2-->Address1: Main Street 24
    Column3--->Address2: c/o John Smith

    Sometimes I also get things like this: Main Street 24, so:

    Column1-->Address: Main Street 24
    Column2-->Address1: Main Street 24
    Column3-->Address2: (stays empty)


    If anyone has any idea, please let me know.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Address1: IIf(InStr([Address],"c/o")>0,Left([Address],InStr([Address],"c/o")-1),[Address])

    Address2: IIf(InStr([Address],"c/o")>0,Mid([Address],InStr([Address],"c/o")+4),Null)
    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
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    Hi June7,

    thanks a lot.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-06-2018, 03:26 PM
  2. Replies: 7
    Last Post: 06-27-2016, 12:28 PM
  3. Transformation from Wide to Tall
    By rigglesbee in forum Programming
    Replies: 5
    Last Post: 08-19-2014, 12:34 PM
  4. Replies: 2
    Last Post: 08-22-2013, 12:02 AM
  5. Input Mask for an IP Address and Mack Address
    By baksg1995 in forum Access
    Replies: 18
    Last Post: 06-23-2009, 12:33 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