Dim Filter As String = "1=1"
Dim dr = e.node.FullPath.split("\") '获取生成此节点的行
If e.Node.Text <> "显示所有行" Then
Select Case e.Node.Level
Case 0
Filter = "[项目名称] = '" & dr(0) & "'"
Case 1
Filter = "[项目名称] = '" & dr(0) & "' And [县] = '" & dr(1) & "'"
Case 2
Filter = "[项目名称] = '" & dr(0) & "' And [县] = '" & dr(1) & "' And [乡] = '" & dr(2) & "'"
Case 3
Filter = "[项目名称] = '" & dr(0) & "' And [县] = '" & dr(1) & "' And [乡] = '" & dr(2) & "' And [村] = '" & dr(3) & "'"
Case 4
Filter = "[项目名称] = '" & dr(0) & "' And [县] = '" & dr(1) & "' And [乡] = '" & dr(2) & "' And [村] = '" & dr(3) & "' And [屯] = '" & dr(4) & "'"
Case 5
Filter = "[项目名称] = '" & dr(0) & "' And [县] = '" & dr(1) & "' And [乡] = '" & dr(2) & "' And [村] = '" & dr(3) & "' And [屯] = '" & dr(4) & "'And [组] = '" & dr(5) & "'"
End Select
End If
DataTables("S征地记录").save
If User.Name = "开发者" Or User.Name = "管理员" Then
DataTables("S征地记录").LoadFilter = filter
DataTables("S征地记录").LoadOrder="协议书编号 Desc"
DataTables("S征地记录").LoadTop= 5
DataTables("S征地记录").Load
Tables("S征地记录").sort="协议书编号"
Else
DataTables("S征地记录").loadfilter = "(乡 = '" & User.Name & "' or 县 = '" & User.Name & "' or 项目名称 = '" & User.Name & "') and " & Filter
DataTables("S征地记录").LoadOrder="协议书编号 Desc"
DataTables("S征地记录").LoadTop= 5
DataTables("S征地记录").Load
Tables("S征地记录").sort="协议书编号"
End If
'Tables("S征地记录").filter = filter
第一页按钮代码:
With DataTables("S征地记录")
.LoadPage = 0 '加载第一页
.Load()
e.Form.Controls("TextBox1").Value = 1 & "/" & .TotalPages
End With