Dim dt As Row = Tables("主页").Current Dim dt1 As Date =dt("开始日") Dim dt2 As Date =dt("截止日") If e.DataCol.Name = "部门" Then Dim nms() As String = {"执版","手雕汇总","电雕"} Dim sty1() As String = {"R","P","E","NL","BL","BG","H"} If e.NewValue Is Nothing Then For Each sty As String In sty1 e.DataRow(sty) = Nothing Next Else For Each nm As String In nms For Each sty As String In sty1 If e.NewValue = nm Then e.DataRow(sty) = DataTables(nm).Compute("Sum(检数量)","款类 = '" & sty & "' and 交货期>=#" & dt1 & "# and 交货期<=#" & dt2 & "#") End If Next Next End If End If
|