Foxtable(狐表)用户栏目专家坐堂 → 此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据


  共有2345人关注过本帖树形打印复制链接

主题:此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据

帅哥哟,离线,有人找我吗?
蓝蚂蚁
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:672 积分:7885 威望:0 精华:0 注册:2016/6/11 11:10:00
此行已从表中移除并且没有任何数据。BeginEdit() 将允许在此行中创建新数据  发帖心情 Post By:2019/10/14 15:11:00 [只看该作者]

副本表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

麻烦老师帮看看,这段代码哪里错了?谢谢!


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107846 积分:548581 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/10/14 15:15:00 [只看该作者]

看不出什么问题。估计是关联触发其它事件出现的问题

调试看是哪一句代码有问题:http://www.foxtable.com/webhelp/scr/1485.htm

 回到顶部