我希望根据是否加载另一个表单来使用IIf语句查询条件 [英] I wish to use IIf statement query criterion based on whether another form is loaded
本文介绍了我希望根据是否加载另一个表单来使用IIf语句查询条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望使用表达式构建器编写一个查询条件,以便在加载另一个表单时拉出一条记录,或者如果不是,则拉出所有记录。我无法使用此代码。
I wish to write a query criterion using expression builder to either pull out one record if another form is loaded, or all records if it isn''t. I can''t get this code to work.
展开 | 选择 < span class =codeDivider> | Wrap | 行号
推荐答案
尝试:
展开 < span class =codeDivider> | 选择 | Wrap | 行号
还有另一种方法,您无需在SQL语句中嵌入逻辑,也无需设置任何标准。您可以:
There is another approach in which you do not have to embed the Logic in the SQL Statement, and you have no need to set any criteria. You can:
- 创建一个通用查询,返回相应字段的所有记录(此演示的qryEmployees)。
- 创建公共函数将:
- 查看是否加载了特定表单(本演示的员工)。
- 根据上述结果修改查询的SQL属性(qryEmployees)。
- 打开查询。
展开 | 选择 | Wrap | 行号
谢谢。我无法得到第一个工作响应并获得与以前相同的错误消息。是否有可能IsLoaded不是表达式构建器中的有效函数?我也尝试了第二个建议,但欢迎一些建议,如何放置此代码。我进入预订表单的''design''然后进入Build Event,但之后我有点迷失了。另外,我应该用_?
Thanks. I can''t get the first response to work and get the same error message as before. Is it possible that ''IsLoaded'' is not a valid function in expression builder? I have also tried the second suggestion but would welcome some advice as to where to put this code. I go into ''design'' of the Bookings form then enter Build Event, but I''m a bit lost after that. Also,should I substitute spaces in form, query and field names with _ ?
这篇关于我希望根据是否加载另一个表单来使用IIf语句查询条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文