临时急用,非常急,刚学要做个简单的筛选功能,如下图所示

我是照抄教程里的,用ComboBox程序如下
Dim Filter As String
With e.Form.Controls("机型列表")
If .Value IsNot Nothing Then
Filter =" 机型 = '" & .Value & "'"
End If
End With
With e.Form.Controls("器件代码列表")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "器件代码= '" & .Value & "'"
End If
End With
With e.Form.Controls("器件名称列表")
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