以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  系统提示代码异常  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=145104)

--  作者:dycwylb
--  发布时间:2020/1/8 15:48:00
--  系统提示代码异常

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20191231093259.png
图片点击可在新窗口打开查看
怎么排除“此行已删除,确允许在此行创建数据”
--  作者:有点蓝
--  发布时间:2020/1/8 16:03:00
--  
提示很明显了,使用了已经删除的行。

窗口sizechanged事件写了什么代码?

--  作者:dycwylb
--  发布时间:2020/1/8 16:27:00
--  


窗口sizechanged事件没有代码
[此贴子已经被作者于2020/1/8 16:30:48编辑过]

--  作者:有点蓝
--  发布时间:2020/1/8 16:34:00
--  
更新foxtable到最新版。具体上传实例测试一下
--  作者:dycwylb
--  发布时间:2020/1/8 16:35:00
--  
窗口关闭后执行I

f Tables("进仓单主表").Current Is Nothing Then
    e.Cancel = False

End If

If Tables("进仓单主表").Current IsNot Nothing Then
    If Tables("进仓单主表").Current.IsNull("入仓单号") = False Then
        Dim dcs As List(Of DataRow) =  Tables("进仓单主表").Current.DataRow.GetChildRows("进仓单明细")
        If dcs.Count = 0 Then
            If MessageBox.Show("没有明细,请检查,是否强行关闭","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes  Then
                Tables("进仓单主表").Current.Delete()
                e.Cancel = False
                         Else
                e.Cancel = True
            End If
        End If
        If dcs.Count > 0 Then
            For Each dc As DataRow In dcs
                If dc.IsNull("编号") OrElse dc.IsNull("品名") OrElse dc.IsNull("规格") OrElse dc.IsNull("单位") OrElse dc.IsNull("数量") OrElse dc.IsNull("单价") OrElse dc.IsNull("入仓单号") OrElse dc.IsNull("申购单号") OrElse dc.IsNull("明细序号") OrElse dc.IsNull("金额") Then
                    If MessageBox.Show("明细必填项有空值,请检查,是否强行关闭","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
                        Tables("进仓单主表").Current.Delete()
                        e.Cancel = False
                        Exit For
                                            Else
                        e.Cancel = True
                        
                    End If
                End If
            Next
        End If
    End If
End If


If Tables("进仓单主表").Current IsNot Nothing   Then
    Dim dz As Row = Tables("进仓单主表").Current
    If dz.IsNull("入仓部门") OrElse dz.IsNull("入库日期") OrElse dz.IsNull("仓管") OrElse dz.IsNull("缴仓") OrElse dz.IsNull("入仓单号")  Then
        
        If MessageBox.Show("主表记录或明细必填项有空值,请检查,是否强行关闭","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
            Tables("进仓单主表").Current.Delete()
            e.Cancel = False
                   Else
            
            e.Cancel = True
        End If
    End If
End If

--  作者:有点蓝
--  发布时间:2020/1/8 17:01:00
--  
Tables("进仓单主表").Current.Delete()这个删除后估计还有触发其他事件使用到这行
--  作者:dycwylb
--  发布时间:2020/1/8 17:03:00
--  
新手帮忙看懂一下代码,有时不知问题出到那,谢谢!
--  作者:dycwylb
--  发布时间:2020/1/8 17:03:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.foxdb


--  作者:有点蓝
--  发布时间:2020/1/8 17:13:00
--  
我测试没有问题,按什么步骤测试有问题。foxtable有没有更新到最新版?
--  作者:dycwylb
--  发布时间:2020/1/9 9:43:00
--  
打开软件,打开管理项目时出现此提示