-- 作者:青丘狐
-- 发布时间:2018/12/26 14:41:00
-- 查询中加入模糊查询
Dim Filter As String = "" With e.Form.Controls("仓库") If .Value IsNot Nothing AndAlso .value <> "仓库" Then Filter = "仓库= \'" & .Value & "\'" End If End With With e.Form.Controls("车船号") If .Value IsNot Nothing AndAlso .value <> "车船号" Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "车船号 = \'" & .Value & "\'" End If End With With e.Form.Controls("品种") If .Value IsNot Nothing AndAlso .value <> "品种" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "品种 = \'" & .Value & "\'" End If End With With e.Form.Controls("规格") If .Value IsNot Nothing AndAlso .value <> "规格" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "规格 = \'" & .Value & "\'" End If End With
With e.Form.Controls("钢种") If .Value IsNot Nothing AndAlso .value <> "钢种" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "钢种 = \'" & .Value & "\'" End If End With
With e.Form.Controls("原始提单信息") If .Value IsNot Nothing AndAlso .value <> "原始提单信息" Then If Filter >"" Then Filter = Filter & " And " End If Filter = "原始提单信息 Like \'%" & .Value & "%\'" End If End With
With e.Form.Controls("提货车号") If .Value IsNot Nothing AndAlso .value <> "提货车号" Then If Filter >"" Then Filter = Filter & " And " End If Filter = "提货车号 Like \'%" & .Value & "%\'" End If End With With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "出库时间 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "出库时间 <= #" & .Value & "#" End If End With
If Filter > "" Then Tables("仓库出库明细").Filter = Filter End If
提货车号和原始提单信息加入模糊查询后,其他的就不能查询了,请问要怎样修改。
|