Is there any code in your form refresh()? Try replacing your last line (thisform.refresh()) with
ThisForm.edtSummary.SetFocus()
Alan
>Thank you very much Nadya
>I did inserted your codes, unfortunately it highlighted the entire contents of the editbox.
>
>txtSearch=upper(ALLtrim(thisform.contSearch.txtSearch.value))
> loca for txtSearch $ UPPER(edtsummary)
> lnPos=at(txtSearch,upper(thisform.edtsummary.value))
> if m.lnPos>0
> thisform.edtsummary.SelStart=m.lnPos
> thisform.edtsummary.SelLength=len(txtSearch)
> endif
> thisform.refresh