不要用CurrentTable.Current
Select Case e.DataCol.Name
Case "休假年份","开始日期","结束日期"
Dim y1,y2 As Date
Dim y3,y4,y,m,d As Integer
If e.DataRow.Isnull("开始日期") = False AndAlso e.DataRow("休假年份") > 2011 Then
y1 = e.DataRow("开始日期")
y2 = e.DataRow("参加工作")
y3 = e.DataRow("休假年份")
If y1.year > y3 Then y1 = cdate("#" & y3 & "-12-31#")
DateYMD(y2,y1,y,m,d)
e.DataRow("工龄") = y
If y > 0 Then e.DataRow("年休假") = 5
If y > 9 Then e.DataRow("年休假") = 10
If y > 19 Then e.DataRow("年休假") = 15
If y = 0 Then e.DataRow("年休假") = Nothing
End If
End Select