参考
If e.DataCol.Name="接收状态" Then
Dim ss,st As String
ss = "工作|物品|账号|其它"
For Each s As String In ss.split("|")
Dim cmd As New SQLCommand
cmd.ConnectionName = "主数据源"
cmd.CommandText = "Select Count(*) From {YW_人事交接" & s & "交接} Where 编号 = '" & e.DataRow("编号") & "' AND 接收日期 IS NULL "
If cmd.ExecuteScalar() <> 0
st = "未完成"
Exit For
End If
Next
If st = "未完成"
e.DataRow("接收状态")= st
Else
e.DataRow("接收状态")= "已完成"
End If
End If