Select Case e.DataCol.Name Case "加班人员" Dim dr As DataRow = e.DataRow.GetParentRow("加班通知单") Dim num As String = Left(dr("加班编号"), 8) Dim fdr As DataRow = e.DataTable.Find("加班编号 like '" & num & "*' And 加班人员 = '" & e.NewValue & "'") If fdr IsNot Nothing Then If fdr.GetParentRow("加班通知单")("时间_开始时间") = dr("时间_开始时间") Then msgbox("重复") e.NewValue = Nothing End If End If End Select