以下是引用大红袍在2016/7/14 9:37:00的发言:
If e.DataTable.Name = "AAA" Then
Select e.DataCol.Name
Case "第一次收益时间","人员姓名"
If e.DataRow.IsNull("第一次收益时间") OrElse e.DataRow.IsNull("人员姓名") Then
e.DataRow("人员编号") = Nothing
Else
Dim d As Date = e.DataRow("第一次收益时间")
Dim fd As Date = d
Dim ld As Date = fd.AddDays(1)
Dim bh As String = e.DataRow("人员姓名") & "-" & Format(d,"yyMMdd") & "-"
If e.DataRow("人员编号").StartsWith(bh) = False
Dim max As String
Dim idx As Integer
Dim flt As String
flt = "人员姓名 = '"& e.DataRow("人员姓名") & "' And 第一次收益时间 >= #" & fd & "# And 第一次收益时间 < #" & ld & "# And [_Identify] <> " & e.DataRow("_Identify")
max = e.DataTable.Compute("Max(人员编号)",flt)
If max > "" Then '如果存在最大单据编号
idx = CInt(max.Substring(bh.length)) + 1
Else
idx = 1
End If
e.DataRow("人员编号") = bh & Format(idx,"0000")
End If
End If
End Select
End If
全局事件表里怎么屏蔽某几个表啊?加判断么?