Dim Filter As String
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
Filter = "单位名称 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "卡片类型 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox3")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "编码 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox4")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "资产分类名称 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox5")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "资产名称 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox6")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "规格型号 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox7")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "品牌 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox8")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "使用部门 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox9")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "存放地点 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox12")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "会计凭证号 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox13")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "处置方式 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "取得日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "取得日期 <= #" & .Value & "#"
End If
End With
With e.Form.Controls("TextBox10")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "价值 >= .value "
End If
End With
With e.Form.Controls("TextBox11")
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