Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim Filter As String
With e.Form.Controls("a")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "负责工程师 = '" & .Value & "'"
End If
End With
With e.Form.Controls("b")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "任务进行状态 < '" & .Value & "' or 任务进行状态 > '" & .Value & "'"
End If
End With
With e.Form.Controls("c")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "实际结束时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("d")
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
请各位高手们帮我简化下这个按钮事件代码。
同时确认下With-----End With 在上面的代码使用过程中是不是有选后顺序之分?
Filter = Filter & "任务进行状态 < '" & .Value & "' or 任务进行状态 > '" & .Value & "'"
改成Filter = Filter & "任务进行状态 <> '" & .Value & "'" 为什么改成这样不行?
Filter = Filter & "实际结束时间 <= #" & .Value & "#" 这里面有<又有=为什么行,为什么上面的 < 和 > 就不行了
哦谢谢