Select Case e.DataCol.name Case "工厂","工段","日期" Dim dr As DataRow = e.DataRow If dr.IsNull("工厂") = False AndAlso dr.IsNull("工段") = False AndAlso dr.IsNull("日期") =False Then Dim pr As DataRow = DataTables("工资标准").Find("分厂 = \'" & dr("工厂") & "\' and 工段 = \'" & dr("工段") & "\' And 执行日期 <= #" & dr("日期") & "#", "执行日期 Desc") If pr IsNot Nothing Then dr("工资标准") = pr("工资标准") End If End If End Select
参考
-- 作者:caiyt0
-- 发布时间:2013/4/22 15:14:00
--
以下是引用XYT在2013-4-22 15:07:00的发言:
DataColChanged事件代码设置为:
Select Case e.DataCol.name Case "工厂","工段","日期" Dim dr As DataRow = e.DataRow If dr.IsNull("工厂") = False AndAlso dr.IsNull("工段") = False AndAlso dr.IsNull("日期") =False Then Dim pr As DataRow = DataTables("工资标准").Find("分厂 = \'" & dr("工厂") & "\' and 工段 = \'" & dr("工段") & "\' And 执行日期 <= #" & dr("日期") & "#", "执行日期 Desc") If pr IsNot Nothing Then dr("工资标准") = pr("工资标准") End If End If End Select
-- 作者:XYT
-- 发布时间:2013/4/22 15:43:00
--
Dim Val As
String = e.Table.Current("订单分解") Select
Case Val Case
"自产" Dim dr As DataRow = e.DataRow If dr IsNot Nothing \'如果找到, 则设置各列内容 e.DataRow("XX")= dr("品名") e.DataRow("xx")= dr("型号") e.DataRow("xx")= dr("规格") End If End select