我现在有3个表:工资表, 岗位薪级表, 特殊薪级表
1、通过“岗位薪级表” ,引用不同“职务”对应的“岗位工资”,引用到工资表中。
2、但是其中有3个人,是通过“特殊薪级表”来匹配的,引用“姓名”对应的“岗位工资”,引用到工资表中。
问题,我怎么下面代码中,剔除这三个人,在代码1中不执行引用。

此主题相关图片如下:岗位薪级.png

代码1:
If e.DataCol.Name = "职务" Then
If e.NewValue Is Nothing Then
e.DataRow("岗位工资") = Nothing
e.DataRow("保密津贴") = Nothing
e.DataRow("竞业限制金") = Nothing
Else
Dim dr As DataRow
dr = DataTables("岗位薪级表").Find("[职务] = '" & e.NewValue & "'")
If dr IsNot Nothing
e.DataRow("岗位工资") = dr("岗位工资")
e.DataRow("保密津贴") = dr("保密津贴")
e.DataRow("竞业限制金") = dr("竞业限制金")
End If
End If
End If
代码2:

此主题相关图片如下:特殊薪级.png

If e.DataCol.Name = "姓名" Then
If e.NewValue Is Nothing Then
e.DataRow("岗位工资") = Nothing
e.DataRow("保密津贴") = Nothing
e.DataRow("竞业限制金") = Nothing
Else
Dim dr As DataRow
dr = DataTables("特殊薪级表").Find("[姓名] = '" & e.NewValue & "'")
If dr IsNot Nothing
e.DataRow("岗位工资") = dr("岗位工资")
e.DataRow("保密津贴") = dr("保密津贴")
e.DataRow("竞业限制金") = dr("竞业限制金")
End If
End If
End If
[此贴子已经被作者于2016/12/1 10:43:28编辑过]