IsNothing的反义词是什么?

gil*_*les 1 vba

我想说的If the field "Resource" holds a value" ... then基本上是相反的

IIF(IsNothing(Fields!Resource.Value)

你能帮忙吗?

Wid*_*dor 11

只需添加NOT:

If Not IsNothing(something) Then ...
Run Code Online (Sandbox Code Playgroud)

编辑:

刚刚看过标签,

Dim myVariable as Object    
If Not myVariable Is Nothing Then ...
Run Code Online (Sandbox Code Playgroud)

  • 10票对错误问题的无意义答案.所以应该为此创建一个徽章!(我承认我很嫉妒:) (2认同)
  • 废话是IsNothing()不存在,而对于第二部分,"Is Nothing"不能用于检查字段是否"保持值".必须使用`Is NUll`. (2认同)
  • -1我必须同意@iDevelop.包括徽章爱德华李尔徽章或许?我将允许IsEmpty作为一个对象,但IsNothing确实没什么. (2认同)