Hi Vaser,
Using a space separator between First & Last name will lead to problems if the Last Name has more than one word like "van Huesen". It's better to use a comma (,) separator i.e. Last Name, First Name. Assuming you are using the comma separator :
S# = INSTRING(',',SEL:Locator,1,1)
CLEAR(PEO:Record)
IF S#
PEO:LastName = SUB(SEL:Locator,1,S#-1)
PEO:FirstName = SUB(SEL:Locator,S#+1,LEN(SEL:Locator)-S#)
ELSE
PEO:LastName = SEL:Locator
END
SET(PEO:Key_LastFirst, PEO:Key_LastFirst)
NEXT(PEOPLE)
BRWn.ResetFromBuffer()
Regards