Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "类别 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "商品编号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox3")
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("ComboBox4")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "供货厂家 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox5")
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