Change the end of first name

It will be equal to whatever name you pass to the function?
Could just as easily be the LastName ?
 
In a standard module you create a function, like gasman suggested.

Code:
Public Function LastNameChar(strName as string) As String

Select case  Right(strName, 2)

case  "ος"
LastNameChar = Left(strName, Len(strName) - 1) & "υ"

Case  "ης"
LastNameChar = Left(strName, Len(strName) - 2) & "ου"

case else
LastNameChar =strName    'if there are no matching right 2 characters

end select

end function

Add whatever other cases you need between the select case and end select lines.

in your afterupdate event put

Code:
Me.txtFirstName = LastNameChar(Me.txtFirstName)
 
Thank you all
 

Users who are viewing this thread

Back
Top Bottom