-- 作者:rgbjwjb
-- 发布时间:2021/3/12 11:05:00
-- 代码有误
Dim Filter As String = "" If e.node.Name <> "显示所有行" Then Dim d1 As Date Dim d2 As Date Dim Year As Integer = e.Node.DataRow("年") Dim Month As Integer = e.Node.DataRow("月") Dim cmz Integer = e.Node.DataRow("村民组") Dim hzxm As String = e.Node.DataRow("户主姓名") Select Case e.Node.Level Case 0 d1 = New Date(Year,1,1) \'取得该年的第一天 d2 = new Date(Year,12,31) \'取得该年的最后一天 Filter = "派工日期 >= #" & d1 & "# And 派工日期 <= #" & d2 & "#" Case 1 d1 = New Date(Year, Month, 1) \'取得该月的第一天 d2 = new Date(Year, Month, Date.DaysInMonth(Year,Month)) \'取得该月的最后一天 Filter = "派工日期 >= #" & d1 & "# And 派工日期 <= #" & d2 & "#" Case 2 d1 = New Date(Year, Month, 1) \'取得该月的第一天 d2 = new Date(Year, Month, Date.DaysInMonth(Year,Month)) \'取得该月的最后一天 Filter = "派工日期 >= #" & d1 & "# And 派工日期 <= #" & d2 & "# And 村民组 = \'" & cmz & "\'" Case 3 d1 = New Date(Year, Month, 1) \'取得该月的第一天 d2 = new Date(Year, Month, Date.DaysInMonth(Year,Month)) \'取得该月的最后一天 Filter = "派工日期 >= #" & d1 & "# And 派工日期 <= #" & d2 & "# And 村民组 = \'" & cmz & "\'and 户主姓名 =\'" & hzxm & "\'" End Select End If Tables("派工单明细表").Filter = Filter
代码运行后,加下划线的一行代码显示有误,如何修改,请指教,谢谢!
|