Results 1 to 2 of 2
  1. #1
    UCBFireCenter is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2009
    Location
    Berkeley, CA
    Posts
    38

    Exclamation Trying to do String Edits...using delimiters and regex...any advice???

    I have a bit of a parsing problem, that I wondered if you all had any advice on.

    So through various work I have whittled down a series of (address) data columns into one column that looks like this:

    A CA 96094
    95607-0628
    L CA 96058
    96076-1305
    A TX 96067
    ...

    My end result needs to isolate the 5-digit zipcode out of this column. The required 5 digits are either 1) to the immediate right of all the letters OR 2) are the 5 digits to the immediate left of the "-" and the 4-digit postal code.

    I've looked carefully at this...and two things jump out:

    1) I have two ready made delimiters: the <blank space> (i.e. "") between the letters and the <dash> "-" between the postal code and the zipcode.

    2) I'm still learning VB programming (taking an intro class in it atm...just started 2 weeks ago)...but I know I could: a) write either a regular expression (using the regex/LISP engine in excel), or b) I could mess around with LEFT and RIGHT and InStr functions in VB.

    Problem is I haven't quite figured out how to set this all up. I've got the skeleton in my head

    //to return string values
    Public Function String

    LeftString("A CA 96094", " ")

    RightString("96076-1305", "-")

    //Need to write functions to use the built in functions of LEFT RIGHT for the functions LeftString and RightString


    /...

    Yeah...any directional advice...am I somewhere close to understanding what I need to resolve this??

    many thanks!!

  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,521
    Please don't post the same question more than once:

    https://www.accessforums.net/program...vice-4787.html
    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. Form sizing advice needed
    By DanW in forum Forms
    Replies: 0
    Last Post: 11-15-2009, 09:35 PM
  2. need some advice building DB (noobie)
    By sureshot in forum Access
    Replies: 2
    Last Post: 10-12-2009, 09:49 AM
  3. advice on planning tables
    By justinm1015 in forum Access
    Replies: 1
    Last Post: 09-16-2009, 02:27 AM
  4. Advice on How to Create these Tables
    By rochy81 in forum Access
    Replies: 2
    Last Post: 05-04-2009, 04:32 PM
  5. Need advice on what I have so far
    By rumplestiltskin in forum Database Design
    Replies: 2
    Last Post: 05-25-2006, 12:48 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