这个代码无效,是不是漏了什么?
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("textbox1")
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("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

此主题相关图片如下:qq图片20140722133551.jpg