我实现了多条件组合查询,代码如下,怎样在此基础实现 缺陷所在相序、所属10千伏线路 、所属支线 的模糊查找呢?
Dim Filter As String
With e.Form.Controls("ComboBox按所属供电所查询")
If .Value IsNot Nothing Then
Filter = "所属供电所 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox按相序查找")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "缺陷所在相序 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox所属10千伏线路")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "所属10千伏线路 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox所在支线")
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