以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请教e.DataRow("开数") = 2  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=11454)

--  作者:annan
--  发布时间:2011/7/29 0:57:00
--  请教e.DataRow("开数") = 2

论坛终于恢复正常了!

 

在表中,我在

DataRowAdding事件中加入了以下代码(当增加行,"开数\'列的值为 2.

e.DataRow("开数") = 2

 

现在我需要:当"宽度"列的值大于87的时候,"开数"列自动减1,直到"宽度"列的值小于或者等于87;

请问这样的代码怎么写


--  作者:狐狸爸爸
--  发布时间:2011/7/29 7:44:00
--  
DataRowAdding执行的时候,宽度列并没有值吧?
--  作者:blackzhu
--  发布时间:2011/7/29 7:44:00
--  
If e.DataCol.Name = "第一列" Then
    If e.DataRow("第一列") > 87  Then \'身份证号码是否为空
        e.DataRow("第二列") =e.DataRow("第二列") -1
    Else
        If e.DataRow("第一列") <= 87 Then
            MessageBox.Show("超过87了")
            e.Cancel = True
        End If
    End If
End If

 这样?