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
参考下