setfilter的问题?急!在线等候
下面是我的代码:我想不通哪儿有错,可是执行时却报expression is not valid
//定义参数: 查询条件综合结果
string LookForCondition
//定义参数:要查询的列
string lookforitem1,lookforitem2,lookforitem3
//定义参数: 要查询的符号
string lookforhow1,lookforhow2,lookforhow3
//定义参数: 要查询的内容
string lookforwhat1,lookforwhat2,lookforwhat3
//定义参数: 不同查询条件的组合操作符号
string lookforoperator1,lookforoperator2
//查询符号的选择
lookforhow1=ddlb_4.text
lookforhow2=ddlb_5.text
lookforhow3=ddlb_6.text
//综合条件1的选择
if ddlb_7.text="与" then
lookforoperator1="and"
elseif ddlb_7.text="或" then
lookforoperator1="or"
elseif ddlb_7.text="非" then
lookforoperator1="not"
end if
//综合条件2的选择
if ddlb_8.text="与" then
lookforoperator2="and"
elseif ddlb_8.text="或" then
lookforoperator2="or"
elseif ddlb_8.text="非" then
lookforoperator2="not"
end if
//查询子段1和查询内容的选择
if ddlb_1.text="出生年月" &
or ddlb_1.text="提职时间" &
or ddlb_1.text="职批时间" &
or ddlb_1.text="工作时间" &
or ddlb_1.text="进院时间" &
or ddlb_1.text="职称时间" &
or ddlb_1.text="工龄" &
or ddlb_1.text="原教龄" &
or ddlb_1.text="年龄" &
or ddlb_1.text="工资" then
lookforitem1=ddlb_1.text
lookforwhat1=sle_1.text
else
lookforitem1=ddlb_1.text
lookforwhat1=""+sle_1.text+""
end if
//查询子段2和查询内容的选择
if ddlb_2.text="出生年月" &
or ddlb_2.text="提职时间" &
or ddlb_2.text="职批时间" &
or ddlb_2.text="工作时间" &
or ddlb_2.text="进院时间" &
or ddlb_2.text="职称时间" &
or ddlb_2.text="工龄" &
or ddlb_2.text="原教龄" &
or ddlb_2.text="年龄" &
or ddlb_2.text="工资" then
lookforitem2=ddlb_2.text
lookforwhat2=sle_2.text
else
lookforitem2=ddlb_2.text
lookforwhat2=""+sle_2.text+""
end if
//查询子段3和查询内容的选择
if ddlb_3.text="出生年月" &
or ddlb_3.text="提职时间" &
or ddlb_3.text="职批时间" &
or ddlb_3.text="工作时间" &
or ddlb_3.text="进院时间" &
or ddlb_3.text="职称时间" &
or ddlb_3.text="工龄" &
or ddlb_3.text="原教龄" &
or ddlb_3.text="年龄" &
or ddlb_3.text="工资" then
lookforitem3=ddlb_3.text
lookforwhat3=sle_3.text
else
lookforitem3=ddlb_3.text
lookforwhat3=""+sle_3.text+""
end if
//查询条件的综合
if ddlb_1.text="" or ddlb_4.text="" then
//用户没有输入查询条件
messagebox("哈哈","请输入查询条件")
elseif ddlb_2.text="" or ddlb_5.text="" then
//用户输入1查询条件
lookforcondition=lookforitem1+lookforhow1+lookforwhat1
elseif ddlb_3.text="" or ddlb_6.text="" then
//用户输入2查询条件
lookforcondition=lookforitem1+lookforhow1+""+lookforwhat1+""+lookforoperator1 &
+" "+lookforitem2+lookforhow2+""+lookforwhat2+""
else
//用户输入3查询条件
lookforcondition=lookforitem1+lookforhow1+""+lookforwhat1+""+lookforoperator1 &
+" "+lookforitem2+lookforhow2+""+lookforwhat2+""+lookforoperator2 &
+" "+lookforitem3+lookforhow3+""+lookforwhat3+""
end if
//设置过滤器
//dw_1.setfilter(lookforcondition)
//过滤数据窗口
dw_1.filter()
//取得符合条件的记录
dw_1.retrieve()