Foxtable(狐表)用户栏目专家坐堂 → 禁止重复值


  共有4031人关注过本帖树形打印复制链接

主题:禁止重复值

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107739 积分:548028 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/5/22 20:18:00 [显示全部帖子]

查多一次

If e.DataCol.Name = "优先等级" Then
    Dim dr As DataRow
    
    dr = e.DataTable.SQLFind("优先等级 = '" & e.NewValue & "' And 当前设计师 = '" & e.DataRow("当前设计师")  & "'")
    If dr IsNot Nothing Then
        MessageBox.Show("同一设计师无法设置两个相同的优先级别")
        e.Cancel = True
else
    dr = e.DataTable.Find("优先等级 = '" & e.NewValue & "' And 当前设计师 = '" & e.DataRow("当前设计师")  & "'")
    If dr IsNot Nothing Then
        MessageBox.Show("同一设计师无法设置两个相同的优先级别")
        e.Cancel = True
    End If
    End If
End If


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107739 积分:548028 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/5/23 9:00:00 [显示全部帖子]

If e.DataCol.Name = "优先等级" Then
if e.DataRow.isnull("优先等级")=false  andalso e.DataRow.isnull("当前设计师") =false
    Dim dr As DataRow
    
    dr = e.DataTable.SQLFind("优先等级 = '" & e.NewValue & "' And 当前设计师 = '" & e.DataRow("当前设计师")  & "' and _identify <> " & e.DataRow("_identify") )
    If dr IsNot Nothing Then
        MessageBox.Show("同一设计师无法设置两个相同的优先级别")
        e.Cancel = True
else
    dr = e.DataTable.Find("优先等级 = '" & e.NewValue & "' And 当前设计师 = '" & e.DataRow("当前设计师")  & "' and _identify <> " & e.DataRow("_identify") )
    If dr IsNot Nothing Then
        MessageBox.Show("同一设计师无法设置两个相同的优先级别")
        e.Cancel = True
    End If
    End If
end if
End If

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107739 积分:548028 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/5/23 9:50:00 [显示全部帖子]

调试技巧:http://www.foxtable.com/webhelp/scr/1485.htm,看哪一句代码出错

 回到顶部