如何在 VBA 中表示不为空
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7635835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to I say Is Not Null in VBA
提问by giles
Hi I have the following expression. I'm trying to say "if the second field Is Not Null". Can you help.
嗨,我有以下表达。我想说“如果第二个字段不为空”。你能帮我吗。
Thanks
谢谢
=Iif((Fields!approved.Value = "N" & Fields!W_O_Count.Value IsNotNull), "Red", "Transparent")
回答by stuartd
Use Not IsNull(Fields!W_O_Count.Value)
用 Not IsNull(Fields!W_O_Count.Value)
回答by Sai Kalyan Kumar Akshinthala
you can do like follows. Remember, IsNull is a function which returns TRUE if the parameter passed to it is null, and false otherwise.
你可以做如下。请记住,IsNull 是一个函数,如果传递给它的参数为 null,则返回 TRUE,否则返回 false。
Not IsNull(Fields!W_O_Count.Value)