Results 1 to 2 of 2
  1. #1
    Reaper is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    57

    Parsing a customer ID

    I have a database with customer information that was imported from an old Excel file. There are dozens of customers that are identified by an ID that is part letters and part numbers, i.e.,


    ABC-001, etc. The reason for the number portion is that some customers have multiple locations so it is used to distinguish them.

    The number of letters and numbers is pretty random and could be 2 to 4 letters or numbers. Who knows why, it's old and I inherited the problem.

    What I need to do is pull the letter part off the ID and use it elsewhere to identify materials received from a particular customer.

    Is there a way to use VBA to pull that portion of the ID up to, but not including the dash? It obviously needs to react to the varying number of letters.

    Thanks for your help.

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Reaper -

    Assuming the letters appear first, you could try something like:

    Left([ID],InStr(1,[ID],"-")-1)

    All the best,

    Jim
    Last edited by ketbdnetbp; 03-06-2013 at 10:51 AM. Reason: typo, last ")"

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

Similar Threads

  1. Parsing Middle of String
    By OprEowyn in forum Queries
    Replies: 4
    Last Post: 02-20-2013, 10:53 PM
  2. Replies: 1
    Last Post: 12-24-2011, 08:48 AM
  3. Parsing, Insert, Concantenate
    By shexe in forum Access
    Replies: 9
    Last Post: 11-15-2011, 02:44 PM
  4. parsing for addition
    By imintrouble in forum Reports
    Replies: 6
    Last Post: 10-27-2011, 03:00 PM
  5. XML Parsing Error
    By pb45102 in forum Access
    Replies: 2
    Last Post: 09-11-2011, 10:20 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