* Lostfocus of search textbox * If directly in grid (ie:inGrid class) * no need for setfocus thisform.lockscreen = .t. && If want to hide scroll animation with ThisForm.Grid1 .setfocus && Needed for relativerow do while .relativerow # 1 && Hit top row ? .doscroll(1) && Scroll down enddo endwith ThisForm.Text2.setfocus && Get focus back to somewhere outside grid thisform.lockscreen = .f.Notice we always rely on the fact that a search in grid returns with a relativerow >= 1 and don't check if we should scroll up.