define class clsform as form > top=5 > left=5 > width=300 > height=300 > myFilter = "H" >*..... >add object mygrid as grid with ; > left=5, top=80, height=15, width=100,; > caption="change" ; > recordsourcetype=4,; > recordsource="select nane from company "+; > "where left(cty_origin,1) <> "+; > <d>trim(this.myFilter)+;</d> trim(thisform.myFilter)+; > " into cursor mycur" >*.... >procedure mycmd.click > thisform.myFilter = 'U' > thisform.mygrid.refresh > thisform.mygrid.setfocus >endprocAnd be sure to keep an index tag on your expression (left(cty_origin,1)). Also left(cty_origin,1) = "H" and cty_origin = "H" would mean same unless you set exact, ansi on. IMHO it's better to have a tag with key expression cty_origin and use cty_origin = "H" in where clause.