老师好:现在随着数据量增多,一些明细不需要加载出来,但是后续报表又需要某些时段的记录,请帮这个窗口代码筛选查询的,帮改为打开项目没有加载数据,而查询筛选能按条件加载出来,万分感谢!
谢谢!
Dim Filter As String
With e.Form.Controls("责任人")
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 e.Form.Controls("已完成").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "是否完成 = True"
End If
If e.Form.Controls("未完成").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "是否完成 = False Or 是否完成 Is Null"
End If
If Filter > "" Then
Tables("项目明细").Filter = Filter
End If