-- 作者:蓝蚂蚁
-- 发布时间:2019/10/14 15:11:00
-- 此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据
副本表Table5 双击时的代码:
Dim name As String = Forms("入库单对日期主窗口").Controls("Table5").Table.DataTable.Name If name="高值耗材对计划日期中继表" Then e.Cancel = True ElseIf name="多单号临时表" If e.Col.Name = "来货单号" Then Dim cr As Row=e.Form.controls("Table2").Table.current e.Cancel = True \'禁止进入编辑状态 Dim s As String Dim s2 As String Dim Pts As List(Of String) =DataTables("多单号临时表").GetValues("清单日期","来货类别=\'正常\'") If Pts.count>0 Then s2=Pts(0) cr("清单日期")=s2 End If Dim Pus As List(Of String) =DataTables("多单号临时表").GetValues("计划日期","来货类别=\'正常\'") If Pus.count>0 Then For i As Integer = 0 To Pus.Count - 1 Dim d1 As Date=Pus(i) s &="/" & Format(d1, "yyyyMMdd") s=s.trim("/") Next cr("计划日期")=pus(0) End If Dim cnt As Integer = DataTables("科室急需提前送货表").Compute("Count([目录编号])", "来货单号=\'"& e.row("来货单号") &"\'") If cnt>0 Then s &="/" & "有"& cnt &"个为科室急需先送" s=s.trim("/") End If cr("备注")=s Dim trs As List(Of DataRow)= DataTables("计划来货登记表").Select("来货单号=\'"& e.row("来货单号") &"\'") If trs.count>0 Then For Each tr As DataRow In trs tr("对来货单号") = True Next End If Dim wrs As List(Of DataRow)= DataTables("科室急需提前送货表").Select("来货单号=\'"& e.row("来货单号") &"\'") If wrs.count>0 Then For Each wr As DataRow In wrs wr("对来货单号") = True Next End If \'-----------------本段代码时从多金额存放表中的datacolchanged中移植过来的,省掉了双击Table2 If cr("清单日期") IsNot Nothing Then Dim dr As DataRow = DataTables("中联电脑入库单").Find("入库单号=\'" & cr("入库单号") & "\'") If dr IsNot Nothing Then dr("清单日期")=cr("清单日期") dr("计划日期")=cr("计划日期") dr("备注")=cr("备注") dr("对来货单号")=True End If End If \'------------------- End If End If
麻烦老师帮看看,这段代码哪里错了?谢谢!
|