以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  批量删除行,报错  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=75763)

--  作者:fytea
--  发布时间:2015/10/14 14:28:00
--  批量删除行,报错

批量删除行报错,什么情况

 


图片点击可在新窗口打开查看此主题相关图片如下:{sfa6ooe3{_j32)`}x48snd.png
图片点击可在新窗口打开查看

--  作者:大红袍
--  发布时间:2015/10/14 14:39:00
--  

上传出错例子,或者贴出DataColChanged事件代码


--  作者:fytea
--  发布时间:2015/10/14 19:47:00
--  

If e.DataCol.Name = "序号" Then
    If e.NewValue = "1" Then
        e.DataRow("页号")=1
    End If
Else
   
    Select Case e.DataCol.Name
        Case "页数"
            For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
                Dim Val1 As Double = e.DataTable.Compute("Sum(页数)","[_SortKey] <= " & dr("_SortKey"))
                           
                dr("页号") = Val1
            Next
    End Select
End If


Dim t As Table = Tables("按卷归整阶段")
For Each r As Row In t.Rows
    r("序号") =r.Index + 1
Next
\'-----------------------------------------------------------

\'-----------------------------------------------------------
If e.DataCol.Name = "是否归档" Then
    If e.DataRow("是否归档") = True Then
        e.DataRow("操作员") = User.Name
        e.DataRow("归档日期") = Date.Now
        \'Else
        \'e.DataRow("取消归整人") = User.Name
        \'e.DataRow("取消归整时间")= Date.Now
    End If
End If
\'-------------------------------------------------------
Select Case e.DataCol.name
    Case "案卷号"
        If e.newvalue > "" Then
            e.DataRow("案卷号")=format(Val(e.newValue),"0000")
        End If
End Select


--  作者:大红袍
--  发布时间:2015/10/14 20:26:00
--  

If e.newvalue > "" Then

 

改成

 

If e.newvalue <> Nothing Then


--  作者:大红袍
--  发布时间:2015/10/14 20:28:00
--  

If e.NewValue = "1" Then

 

改成

 

If Cstr(e.NewValue) = "1" Then