Dim Filter As String
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
Filter = "文件名称 = '" & .Value & "'"
End If
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "项目名称 = '" & .Value & "'"
End If
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "附件 = '" & .Value & "'"
End If
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
Forms("工程部技术文件查找").close
执行之后输入筛选条件,显示结果为空。