以文本方式查看主题

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

--  作者:Lc
--  发布时间:2014/4/2 17:01:00
--  禁止重复

开始日期类型是:日期时间

 

Select Case e.DataCol.name
    Case "开始日期"
        If e.NewValue > "" AndAlso e.DataRow.IsNull("请假人") = False
            Dim dr As DataRow = e.DataRow
            If e.DataTable.Find("请假人 = \'" & dr("请假人") & "\'and 开始日期 = \'" & e.NewValue & "\'") IsNot Nothing Then
        MessageBox.Show(" " & dr("请假人")  & "   " & e.NewValue &"   已输入!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
      e.Cancel = True
    End If
End If
End Select


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20140402170030.png
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2014/4/2 17:12:00
--  
日期列要用 #号

空值判断应该使用

e.datarow.isnull("日期")  不要用e.newValue> ""

--  作者:Lc
--  发布时间:2014/4/2 17:16:00
--  

谢谢