This can be a considerable complex task in terms of software development.
Much of how difficult this task will be is how rigid, or how well the field
name is formatted.
St. Pierre
The above, is the last name = St.
and the suffix = Pierre
As you can see, this rapidly becomes a difficult task. In fact, if the
computer could easily figure out how to do this, the computer likely could
also take over your job.
So, if the suffix IS ALWAYS followed by a "," (comma), and it is consistent
then you can accomplish your goal with relative ease. If the software you
desire has to look at the name, and figure out the suffix, then you are big
trouble!!
if *always* the suffix if a "comma + suffix", then it is relative easy to do
this.
eg:
Smith, Sr.
Kallal, Jr.
etc...
The follow code would do accomplish this task
Public Sub GrabSuffix()
Dim strSql As String
Dim rst As DAO.Recordset
Dim intCommaLoc As Integer
strSql = "select * from tblcustomers where LastName is not null"
Set rst = CurrentDb.OpenRecordset(strSql)
Do While rst.EOF = False
' check if last name as a "," in it
intCommaLoc = InStrRev(rst!LastName, ",")
If intCommaLoc > 0 Then
' we have the postion of the comma. Move this to our new suffix
field
' but, skip the comma
rst.Edit
rst!Suffix = Trim(Mid(rst!LastName, intCommaLoc + 1))
rst!LastName = Left(rst!LastName, intCommaLoc - 1)
rst.Update
End If
Loop
rst.Close
MsgBox "conversion complete"
End Sub
Please note you should only attempted this code on a copy of the data until
your are VERY much satisfied with the results.
The above code is also "air" code, and un-tested (I just typed it as I am
typing now...so, it is off the top of my head, but looks very close to what
you need).