Dim flt As String
For Each s As String In "报价单号|客户名称|合同单号".Split("|")
If e.Form.Controls(s).Text > "" Then
flt + = " And " & s & " Like '%" & e.Form.Controls(s).Text & "%'"
End If
Next
If flt > "" Then
flt = flt.SubString(5)
End If
Tables("报价单").Filter = flt
应该是这样吧:
Dim flt As String
For Each s As String In "报价单号|客户名称|合同单号".Split("|")
If e.Form.Controls(s).Text > "" Then
flt + = " Or " & s & " Like '%" & e.Form.Controls(s).Text & "%'"
End If
Next
If flt > "" Then
flt = flt.SubString(4)
End If
Tables("报价单").Filter = flt
[此贴子已经被作者于2015/3/6 16:24:28编辑过]