Dim Filter As String =""
Dim T As String = e.Form.Controls("关键字").Value
For Each dc As Col In Tables(Args(1)).Cols '遍历表的所有列
If dc.DataCol.IsDate OrElse dc.DataCol.IsBoolean OrElse dc.DataCol.IsNumeric Then '如果是时间列,逻辑列,数值列
Continue For '排除
End If
If Filter > "" Then
Filter = Filter & " Or "
End If
Filter = Filter & "[" & dc.Name & "] Like '%" & T & "%'" '根据控件值迷糊筛选
Next
With e.Form.Controls("开始日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "采购日期 >= '" & .Value & "'"
End If
End With
With e.Form.Controls("结束日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "采购日期 <= '" & .Value & "'"
End If
End With
If Filter > "" Then
我想找出日期段内的关键字 现在还是会出现不是我设定的日期段的数据