Select FI Locate Locate For Alltrim(FI.ref) == '2118661' If Found() SFT.pageframe1.ActivePage=1 SFT.pageframe1.Page1.Cont1.grid1.SetFocus() Else Messagebox("not found") EndifIn fact, the record pointer select the line of my grid where Alltrim(FI.ref) == '2118661', but after that , the record pointer return to the first line in the Grid without making the setfocus on the line with the value i want to locate.