关于grid控件的问题?
一个查询问题:一个command()按钮,其相应代码为:
strsql="select * from content into tempsql where 1=1"
if !empty(allt(thisform.text1.text)) then
strsql=strsql+" and serialno like '%"+allt(thisform.text1.text)+"%'"
endif
if !empty(allt(thisform.text2.text)) then
strsql=strsql+" and reportno like '%"+allt(thisform.text2.text)+"%'"
endif
if !empty(allt(thisform.text3.text)) then
strsql=strsql+" and name like '%"+allt(thisform.text3.text)+"%'"
endif
if !empty(allt(thisform.text4.text)) then
strsql=strsql+" and company like '%"+allt(thisform.text4.text)+"%'"
endif
if !empty(allt(thisform.text5.text)) then
strsql=strsql+" and locate like '%"+allt(thisform.text5.text)+"%'"
endif
thisform.Grid1.recordsourcetype=4 &&查询
thisform.grid1.columncount=-1
thisform.grid1.recordsource=strsql
thisform.grid1.refresh
第一次点按钮grid里有数据显示,第二次点时什么也没有了