Dim filter As String
Dim sts () As String = {"客户","订单号码","销售员","客户订单"}
For Each st As String In sts
Dim val As String = e.Form.Controls(st).value
If val > "" Then '如果不是空
Val = val.replace("*","[*]") '把"*" 符号变成字符才能使用
If filter = "" Then
filter = st & " like '*" & val & "*'"
Else
filter = filter & " and " & st & " like '*" & val & "*'"
End If
End If
Next
Tables("订单明细表").Filter = Filter
1.增加“开始日期” 和 “结束日期”,以上模糊查询,代码怎样写?
此主题相关图片如下:2019-08-13.jpg
[此贴子已经被作者于2019/8/13 14:24:54编辑过]