http://www.foxtable.com/webhelp/topics/2925.htm、http://www.foxtable.com/webhelp/topics/0604.htm
不要搞那么复杂
Select Case e.DataCol.name
Case "岗位"
Dim count As Integer = DataTables("员工花名册").Compute("count(姓名)", "企业名称 = '" & e.DataRow("企业名称") & "' And 现所在单位 = '" & e.DataRow("部门") & "' And (岗位 = '" & e.DataRow("岗位") & "' or 其他岗位 = '" & e.DataRow("岗位") & ")")
If count > 0 Then
e.DataRow("人数") = count
Else
e.DataRow("人数") = Nothing
End If
End Select