老师,请帮忙看看下面代码:
Dim Filter As String
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
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
If .Value = "计件工价" Then
Filter = Filter & "注释 <> '全套' Or 注释 Is Null"
End If
If .Value = "多套模具组合工价" Then
Filter = Filter & "注释 = '全套'"
End If
End If
End With
If Filter > "" Then
Tables("机房计件工价").Filter = Filter
End If
由于注释含有全套、其他字符和空值,
筛选注释不是全套+不同类别时,筛选结果并不是我想要的同时满足:注释不是全套和不同类别。