--
If e.DataCol.Name = "姓名" Then
If e.DataRow.IsNull("姓名") Then
e.DataRow("序号") = Nothing
Else
Dim max As String
Dim idx As Integer
max = e.DataTable.Compute("Max(序号)","[_Identify] <> " & e.DataRow("_Identify"))\'取得该月的最大编号
If max > "" Then \'如果存在最大编号
idx = CInt(max) + 1 \'获得最大编号的后三位顺序号,并加1
Else
idx = 1 \'否则顺序号等于1
End If
e.DataRow("序号") =Format(idx,"0000")
End If
End If
Select Case e.DataCol.name
Case "入职日期"
If e.DataRow.IsNull("入职日期") Then
e.DataRow("工龄_年") = Nothing
e.DataRow("工龄_月") = Nothing
e.DataRow("工龄_日") = Nothing
Else
Dim y,m,d As Integer
DateYMD(e.DataRow("入职日期"),Date.Today,y,m,d)
e.DataRow("工龄_年") = y
e.DataRow("工龄_月") = m
e.DataRow("工龄_日") = d
End If
End Select
帮我看看有没有错~~