Results 1 to 3 of 3
  1. #1
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71

    Copy and paste text from begining of line and pasting to another place

    I have records that contain the begining of the information I want to have in a specific line by itself. I need to go into the field for each record and copy the text before the "\" and then go to another feild in that record and paste it in there. How do I do that?



    Example of text in field "Location" for a record
    "Dallas\121 smithy rd\dallas\texas\76177"

    What I need in the field Alias
    "Dallas"

    There are sometimes spaces between the words, I need everything before the "\". thanks for your help. I'm using a query to work on the data now, but is going to take me a very long time to do manually. 20k records in all.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Use string manipulation functions to extract text.

    Left([fieldname], InStr([fieldname], "\") - 1)

    However, InStr will error if the field is null.

    Left([fieldname], InStr(Nz([fieldname],""), "\") - 1)
    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
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    Perfect, thank you very much for such a quick reply.

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

Similar Threads

  1. VBA - copy memo, paste as text in email app
    By Goodge12 in forum Programming
    Replies: 5
    Last Post: 09-10-2014, 12:12 PM
  2. Copy and Paste Row (vb)
    By Computer202 in forum Programming
    Replies: 7
    Last Post: 03-28-2014, 01:59 AM
  3. Replies: 2
    Last Post: 05-28-2013, 12:32 PM
  4. Copy and pasting data in form view help
    By Ash1402 in forum Forms
    Replies: 8
    Last Post: 10-13-2012, 12:36 PM
  5. Copy-Paste
    By BorisGomel in forum Access
    Replies: 4
    Last Post: 10-25-2011, 07:17 AM

Tags for this Thread

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