工资明细表的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
If dr("工资类型") = "计件" Then
dr("计件标准") = pr("计件标准")
ElseIf dr("工资类型") = "零工" Then
dr("零工标准") = pr("零工标准")
End If
End If
End If
End Select