加好友 发短信
等级:超级版主
帖子:106097
积分:539590
威望:0
精华:9
注册:2015/6/24 9:21:00
|
Post By:2021/12/1 16:15:00 [显示全部帖子]
DataColChanged事件中设置如下代码: 1 2 3 4 5 6 7 8 9 10 11 12 | If e.DataCol.Name = "客商编码" Then '如果内容发生变动的是品名列 If e.NewValue Is Nothing Then '如果新值是空白,也就是品名列的内容为空 e.DataRow("标志列") = false '那么清空此行单价列的内容 Else Dim dr As DataRow '否则在产品表查找同名的产品行,将找到的行赋值给变量dr dr = DataTables("表C").Find("[客商编码] = '" & e.NewValue & "'") If dr IsNot Nothing Then '如果找到了同名的产品行,也就是dr不是Nothing e.DataRow("标志列") = true End If End If End If |
|
|