各位大神、老师:
我运用表事件进行编程时:
Dim dr2 As Date= Date.Today
Dim dr1 As Date= e.DataRow("失效日")
If e.DataCol.Name ="失效日" Then
Dim y2 As Integer= dr2.Year
Dim y1 As Integer= dr1.Year
If y1>y2 Then
e.DataRow("是否有效")=True
If y1<y2 Then
e.DataRow("是否有效")=False
Else
Dim m2 As Integer= dr2.Month
Dim m1 As Integer= dr1.Month
If m1>m2 Then
e.DataRow("是否有效")=True
If m1<m2 Then
e.DataRow("是否有效")=False
Else
Dim d2 As Integer= dr2.Day
Dim d1 As Integer= dr1.Day
If d1>=d2 Then
e.DataRow("是否有效")=True
If d1<d2 Then
e.DataRow("是否有效")=False
End If
End If
End If
End If
End If
End If
End If
做一个客户列表的有效性,但是代码好像不管输入日期是不是当前日期前或者后,都是有效。