Change the end of first name (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 08:48
Joined
Sep 21, 2011
Messages
14,253
It will be equal to whatever name you pass to the function?
Could just as easily be the LastName ?
 

moke123

AWF VIP
Local time
Today, 03:48
Joined
Jan 11, 2013
Messages
3,913
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)
 

mikekal

Member
Local time
Today, 00:48
Joined
Jun 24, 2017
Messages
114
Thank you all
 

Users who are viewing this thread

Top Bottom