Dim Filter As String
Dim str As String
With e.Form.Controls("TextBoxZBH")
If .Value IsNot Nothing Then
Filter = "自编号 = " & .Value & " "
End If
End With
With e.Form.Controls("TextBoxCPH")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "车牌号 = \'" & .Value & "\'"
End If
End With
With e.Form.Controls("TextBoxName")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = "车辆名称 = \'" & .Value & "\'"
End If
End With
With e.Form.Controls("TextBoxGS")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "所属公司 = \'" & .Value & "\'"
End If
End With
With e.Form.Controls("TextBoxLX")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
str = "\'%" & .Value & "%\'"
Filter = Filter & "运行路线 = \'" & .Value & "\'"
End If
End With
If Filter > "" Then
Tables("候运客运车辆明细表").Filter = Filter
End If