本身就是这样呀,你想查询张三,怎么查李四呢? 除非你只查日期.
Dim Filter As String
With RibbonTabs("Workday").Groups("Filter").Items("cmbCustomer")
If .Text IsNot Nothing Then
Filter = "落实人 like '*" & .Text & "*'"
End If
End With
With RibbonTabs("Workday").Groups("Filter").Items("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "发布日期 >= #" & .Value & "#"
End If
End With
With RibbonTabs("Workday").Groups("Filter").Items("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
这样改可以模糊查询名字.