如何在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 11:59:27  来源:igfitidea点击:

How to I say Is Not Null in VBA

vbams-accessnullaccess-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)