以文本方式查看主题

-  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=152213)

--  作者:nxdx112
--  发布时间:2020/7/9 17:07:00
--  系统错误
刚才在DataColChanged 添加了下列,出现
Select Case e.DataCol.name
    Case
 "楼号","宿舍"
        
Dim dr As DataRow = e.DataRow
        
If dr.IsNull("楼号") = False AndAlso dr.IsNull("宿舍") = False Then
            If e.DataTable.Compute("Count([_Identify])","楼号 = \'" & dr("楼号") & "\' And 宿舍 = \'" & dr("宿舍") & "\'") > 1 Then
                MessageBox.Show(
"已经存在相同楼号和宿舍的行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                e.
DataRow(e.DataCol.Name) = e.OldValue \'取消输入
            
End If
        End
 If
End
 
Select

图片点击可在新窗口打开查看此主题相关图片如下:360截图20200709170116846.jpg
图片点击可在新窗口打开查看

进入后点击确定,自动退出
[此贴子已经被作者于2020/7/9 17:07:42编辑过]

--  作者:有点蓝
--  发布时间:2020/7/9 17:24:00
--  
DataColChanged 还有没有其它代码,全部发上来看看
--  作者:nxdx112
--  发布时间:2020/7/9 17:37:00
--  
按住ctrl 进入后项目后在该表属性中删除了代码就好了,谢谢!