Dim Filter As String = "[生成立项] = true AND [生成结项] = FALSE"
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "立项日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "立项日期 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("公司业绩查询窗口_Table1").Filter = Filter
End If