Dim Filter As String
With e.Form.Controls("cmbProduct")
If .Value IsNot Nothing Then
Filter = " 管理部 = '" & .Value & "'"
End If
End With
With e.Form.Controls("cmbCustomer")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & " 类别 = '" & .Value & "'"
End If
End With
With e.Form.Controls("cmbEmployee")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & " 经办人 = '" & .Value & "'"
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & " 登记时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
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
写了这段筛选的代码,怎么前面的都不执行,只有登记时间的可以筛选,哪里出问题了