MainTable = Tables("rs_indepot")
Dim dt As Date = Date.Today.AddDays(-450)
Dim dr As DataRow = DataTables("rs_userinfo").find("sname = '" & rsuser & "'") '找到当前登录者所在的行
Dim filter As String = "1=2"
If dr("position") = "管理者" Then
Dim drs = DataTables("rs_departinfo").Select("departno like '" & dr("departno") & "%'")
For Each cdr As DataRow In drs
Filter &= " or outdepart = '" & cdr("depart") & "'And rstype = '派货'And checkdate >= '" & dt & "'Or checkdate = #01/01/1900#" ‘老师这段代码是不是有问题?
Next
Else If dr("position") = "职员" Then
Filter = "outdepart = '" & dr("indepart") & "'And rstype = '派货'And checkdate >= '" & dt & "'Or checkdate = #01/01/1900#"
End If
DataTables("rs_indepot").LoadTop = "1000"
DataTables("rs_indepot").LoadOrder = "checkdate DESC"
Tables("rs_indepot").OpenLoadTree("outdepart|checkdate YM|ordercode|proname",200,1000,True,Filter) ’我为了让数据加载更改高效,在Filter中添加只加载450天内的数据,请问这让是有帮助吗? 我想确认生成加载树并加载数据,添加450天内是否对加载树生成和加载数据效率有提升?
Tables("rs_indepot").Sort = "checkdate DESC"
Forms("派货出库汇总").Open()