Using “Is Null” as a criteria based on a form

末鹿安然 提交于 2019-12-07 18:59:48

问题


I'm trying to get my query to only return null records if a radio box on a form is ticked. If I manually include the criteria Is Null in the query it works just fine, and elsewhere things like

IIf([Forms]![Reports]![Status - Active]=True,"Active")

work just fine.

However,

IIf([Forms]![Reports]![Status - Null]=True,"Is Null")

just ignores it (I assume because it's actually looking for the text "Is Null" rather than null records) and

IIf([Forms]![Reports]![Status - Null]=True,Is Null)

fails because it's too complex. Is there any way of achieving what I'm trying to achieve?

Thanks.


回答1:


You could work around in a couple of ways, for example.

SELECT t.atext
FROM Table1 t
WHERE IsNull([atext])=[Forms]![Reports]![Status - Null]

BTW, Immediate If (IIf) takes three arguments.



来源:https://stackoverflow.com/questions/13413987/using-is-null-as-a-criteria-based-on-a-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!