Dim tbl As Table = Tables("窗口6_Table1")
Dim Filter As String
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = "年度 = '" & .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 & "月份 = '" & .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 & "日期 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "检验区分 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "班组长 = '" & .Value & "'"
End If
End With
If Filter > "" Then
tbl.Filter = Filter
Tables("制造质量管理").Filter = Filter
End If
谢谢,按照楼上的改完,达到预想,但是我加了两行命令,筛选检验区分及班组长条件时,系统不报错,但是无筛选数据。检验区分及班组长是字符型的,请老师指教!