Is there a way to split a field in access, like full name, into 2 fields?
I don't know how complex or clean your names are, but name parsing can be
tricky. I have a 7 page algorithm and several lookup tables that is my
name-parsing subsystem with several rules:
Below are some comments and examples taken from my code that might give you
some examples. We store contactnames as FirstNamePrefix, FirstName,
MiddleName, LastName, LastNameSuffix
' Rule 1: Clean the name (has its own internal rules)
' "ATTN Mr Maj @#$%^* }{ Gen.Robert (Bob) Stevens van ter
Hoffen-Schlager Sr. MD, Computer Guy"
' -> "ATTN Mr Maj Gen. Robert Stevens van ter Hoffen-Schlager Sr. MD"
' Rule 2: Remove anything that's in the dropwords list.
' "ATTN Mr Maj Gen. Robert Stevens van ter Hoffen-Schlager Sr. MD" ->
' "Mr Maj Gen. Robert Stevens van ter Hoffen-Schlager Sr. MD"
' Rule 3: Move all tokens that are salutations into the prefix string
' stop at the first token that is not a salutation.
' "Mr Maj Gen. Robert Stevens van ter Hoffen-Schlager Sr. MD"
' -> "Robert Stevens van ter Hoffen-Schlager Sr. MD"
' prefix -> "Mr Maj Gen."
' Rule 4: Move all tokens that are last name suffixes into the suffix
' string stop at the first token that is not a last name suffix.
'"Robert Stevens van ter Hoffen-Schlager Sr. MD"
' -> "Robert Stevens van ter Hoffen-Schlager"
' suffix -> "Sr. MD"
' Rule 5: Move all tokens that are last name prefixes into the beginning
' of the last name. Stop at the first one that is not a prefix.
' "Robert | Stevens | van | ter | Hoffen-Schlager"
' -> "Robert | Stevens | van ter Hoffen-Schlager"
' Rule 6: Define First, Middle & Last names thusly:
' Remove all zero length tokens
' Count tokens
' If only one, it is last name
' If two, assign to FirstName, LastName
' If three, assign to FirstName, MiddleName, LastName
' If three or more, first token is FirstName, last token is LastName
'everything else is the MiddleName
' Rule 7: Drop last name if NA, NK, NN, NONE, NOT, or only one character
' Rule 8: Drop last name if all the same character
' Rule 9: Truncate to fit
' Truncate to fit the database column and prevent truncation errors.