求红色部分正确代码,意思是当关联表“生产目录”的“工艺工时_天数”列单元格不为空值时,往下执行 if e.DataCol.Name = "图号" OrElse e.DataCol.Name = "工序_序号" Then if dr.IsNull("图号") OrElse dr.IsNull("派工单号") OrElse dr.IsNull("工序_序号") OrElse dr.IsNull("工艺工时_天数") OrElse dr("状态") = "暂停" Then dr("计划日期_结束") = Nothing dr("计划日期_开始") = Nothing Else Dim Sum As Double = Tables("生产工序").Compute("Sum(工艺工时_天数)","[图号] = '" & dr("图号") & "' And [派工单号] = '" & dr("派工单号") & "' And [状态]= '执行' And [工序_序号] <= " & dr("工序_序号") ) Dim Sum1 As Double = Tables("生产工序").Compute("Sum(工艺工时_天数)","[图号] = '" & dr("图号") & "' And [派工单号] = '" & dr("派工单号") & "' And [状态]= '执行' And [工序_序号] >= " & dr("工序_序号")) Dim pr As DataRow = dr.GetParentrow("生产目录") Dim pr1 As String = pr("工艺工时_天数") if pr1 IsNot Nothing Then if pr IsNot Nothing Then dr("计划日期_结束") = pr("到料日期").AddDays(Sum * (pr("生产周期")/pr("工艺工时_天数"))) dr("计划日期_开始") = pr("完工日期").AddDays(-Sum1 * (pr("生产周期")/pr("工艺工时_天数"))+0.5) Else dr("计划日期_结束") = Nothing dr("计划日期_开始") = Nothing End If End If End If End If