parse a text field RRS feed

  • Question

  • How do you parse a field within MS Access?  For example, you have a field containing a first and last name.  The number of characters are going to vary based on length of name.  How does one work with that?

    Don Fox

    Tuesday, August 16, 2016 2:59 PM


  • Assuming a name such as:

    Don Fox

    You can get the first name simply by doing:

    Left("Don Fox", InStr("Don Fox", " ")-1)

    And the last name with:

    Right("Don Fox", InStr("Don Fox", " ")-1)

    Mid("Don Fox", InStr("Don Fox", " ")+1)

    Daniel Pineault, 2010-2012 Microsoft MVP
    MS Access Tips and Code Samples:

    • Marked as answer by Barely_There Tuesday, August 16, 2016 3:41 PM
    Tuesday, August 16, 2016 3:09 PM

All replies