组合框用于过滤y / n字段 [英] Combobox to filter a y/n field

查看:92
本文介绍了组合框用于过滤y / n字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用组合框根据ay / n字段过滤报表结果的正确语法是什么,如果组合框为空则不应用过滤器?


this是我到目前为止:

What is the proper syntax to a use a combo box to filter results of a report based on a y/n field and apply no filter if the combo box is empty?

this is what I have so far:

展开 | 选择 | Wrap | 行号

推荐答案

moishy101,


我希望Report的RecordSource基于一个查询,该查询使用表单上的Yes / No CheckBox和ComboBox的值。在查询设计过程中非常简单。


如果ComboBox为空,您可以建立阻止过滤的查询参数。


如果有帮助,请告诉我,或者如果需要,请发送其他信息。


干杯!
moishy101,

I would have the RecordSource for the Report be based on a query that uses the values from the Yes/No CheckBox and the ComboBox on the form. Very simple to do in the query design process.

You can establish query parameters that prevent filtering if the ComboBox is empty, also.

Let me know if this helps, or send additional info if required.

Cheers!


我不想更改记录来源我正在尝试使用DoCmd.OpenReport的where子句进行过滤。
I don''t want to change the record source of the report, I''m trying to filter using the where clause of DoCmd.OpenReport.


我不确定记录源是否可以在报告中自行更改,因为它在技术上是一组静态数据。可以对表单进行控制,根据其他控件进行计算,但我知道无法更改记录源。也许可能有一些专家知道如何去做。我很想知道它是否可能.....


我想这就是为什么我的建议是根据某些条件提供记录集的动态查询和标准。那么你就是两全其美的。您永远不必弄乱报告中的记录来源,而是根据报告外部的标准获取必要的记录。
I''m not sure the record source can be changed in a report by itself, because it is technically a static set of data. It is possible to have controls on a form which calculate based on other controls, but I know of no way to change the record source. Perhaps there might be some experts who know how to do it. I would be interested to know if it''s possible.....

I guess that is why my recommendation was to have a dynamic query that provided a recordset according to certain conditions and criteria. Then you have the best of both worlds. You never have to mess with the record source on the report, but get the necessary records based on criteria external to the report.


这篇关于组合框用于过滤y / n字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆