加一个条件你应该没问题的吧:
If DataTables("表A").Find("[姓名] Is Null And [国籍] <> '城堡' And [接诊医生] = '" & _
User.Name & "'") IsNot Nothing Then
Dim Result As DialogResult
Result = Messagebox.Show("你在""表A""表中存在没有输入姓名的记录," & _
"请删除后再关闭项目!","提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
If Result = DialogResult.OK Then
e.Cancel = True '取消关闭项目
Tables("表A").Filter = "[姓名] Is Null And [国籍] <> '城堡' And [接诊医生] = '" & User.Name & "'"
MainTable = Tables("表A")
Return
End If
End If