Thank you for your answer Al. My situation is the "hnoeMD"? So which
code
should I use?
Hi Jimmy:
Do you wish to have the last 2 letters of each record's [Totalname] field
placed into [Newfield], or does Totalname have several words? For example,
if you have John Doe MD, you want "MD"? or "hnoeMD"? The former is
easy-
just do a [Newfield] = Right([Totalname], 2); with the latter I'd do
something like-
Dim ii As Integer, value As String, xx As String, yy As String
xx = ""
value = [Totalname]
For ii=1 to Len(value)
yy = Mid(value, ii, 1)
If yy <> " " Then
xx = xx + yy
Else ' word separator " "
If isnull([newfield1]) then
[NewField1] = Right(xx,2) ' s.a. the first name's last 2 digits
else
If IsNull([NewField2]) Then
[NewField2] = Right(xx,2) ' s.a. the last name's last 2 digits
Else
[NewField3] = Right(xx,2) ' s.a. the title's last 2 digits
End If
End If
End If
Next i
That's it... should work without too many bugs...
Regards,
Al
I have a field wich is called "Totalname". That field contains surnames.
What I need is to have the two last letters of each word of that field
into
another new field which I'll name it"Newfield". Can someone help me
please.
Thanks
Jimmy