客户要查询市区,房型,朝向,房屋所有权。分别为多个复选框,比如房型分为,套一,套二,朝向分为东,南等等,在查询时客户有可能县选择市区,也可能先选择房型,我想做的就是,
tj='1=1 '
if not empty(thisform.cbo市区.displayValue)
tj=tj+' and 市区=thisform.cbo市区.displayValue '
endif
if not empty(thisform.cbo房型.displayValue)
tj=tj+' and 房型=thisform.cbo房型.displayValue '
endif
if not empty(thisform.cbo朝向.displayValue)
tj=tj+' and 朝向=thisform.cbo朝向.displayValue '
endif
if not empty(thisform.cbo房屋所有权.displayValue)
tj=tj+' and 房屋所有权=thisform.cbo房屋所有权.displayValue '
endif
tj=''
hastj=.f.
if thisform.check1.value
if hastj
tj=tj+' and'
endi
tj=tj+' allt(市区)==allt(thisform.combo1.value)'
hastj=.t.
endi
if thisform.check2.value
if hastj
tj=tj+' and'
endi
tj=tj+' allt(房型)==allt(thisform.combo2.value)'
hastj=.t.
endi
if thisform.check3.value
if hastj
tj=tj+' and'
endi
tj=tj+' allt(朝向)==allt(thisform.combo3.value)'
hastj=.t.
endi
if thisform.check4.value
if hastj
tj=tj+' and'
endi
tj=tj+' allt(房屋所有权)==allt(thisform.combo4.value)'
hastj=.t.
endi
set filt to
set filt to &tj
go top
thisform.grid1.refresh