Tables("生产计划").Current("编制人") = UserName Dim dr2 As Row =Tables("生产计划").Current Dim s As String =Format(dr2("某列"),"yyy年MM月") Dim drs As List (of DataRow)=DataTables("领料明细").Select("领料单号='"&Tables("生产计划").Current("领料单号") &"'") For Each dr As DataRow In drs Dim dr1 As DataRow =DataTables("计划耗用结存").find("发生年月= '" & s & " 'and 部门='"&dr2("部门")&"'and 物料编码= '"&dr("物料编码")&"'") If dr1 Is Nothing OrElse dr1("月末结余_投入数") < 0 Then MessageBox.show("累计发出材料数量超过耗用定额,请找领导审批","提示") End If Next Tables("材料领用").Current.Save() DataTables("领料明细").Save()
|