设置第一个过滤器后,访问过滤器不会显示可供选择的值列表 [英] Access filter won't show value list to choose from after 1st filter is set
问题描述
我在使用 Access 2007 中的表单过滤器时遇到了一些问题.我在一些表单中使用列表视图,用户需要能够在那里进行过滤.
I'm having a little trouble with the form filter in Access 2007. I'm using the listview in a few forms and the user needs to be able to filter there.
出于测试目的,我进行了查询,该查询仅基于一张表.如果我想设置第一个过滤器,它看起来像这样:
For testing purposes I made a query, which is just based on one table. If I want to set the first filter, it looks like that:
我选择了一个值,如果我想设置另一个过滤器(显然是在不同的字段上),则没有可供选择的值.
I choose a value and if I want to set another filter (on a different field obviously), there aren't values available to choose from.
这似乎只有在我使用查询时才会发生(如果我使用每个字段或仅使用几个字段都没有关系,基于一个表或多个链接表).我当然可以使用数字过滤器并手动输入一个值.
This seems to happen only if I use a query (doesn't matter if I use every field, or just a few, based on one table or multiple linked tables). I can of course use the number filter and enter a value manually.
我有另一个数据库,我可以随时随地使用过滤器,无论是查询还是表 - 我都有一个列表,每次都有可供选择的值.这意味着我在某处搞砸了一些东西,但我完全不知道在哪里.
I have another database, where I can use filters when and wherever I want, regardless whether it is a query or a table - I have a list with values to choose from everytime. This means I messed something somewhere up but I have absolutely no clue where.
我使用的是 Access 2007 (FE/BE),如果您需要更多详细信息,请直接询问.非常感谢任何从哪里开始寻找的建议!
I'm using Access 2007 (FE/BE), if you need any further details, just ask. Any advice where to start looking is very appreciated!
推荐答案
嗯,玩了半天,终于知道是什么问题了.
Well, after playing around for a long while, I figured out what the problem is.
表单记录源需要是一个查询 - 没有 sql 代码,没有select * from query",只是查询的名称.其他任何事情都会导致您在使用过滤器方面受到限制.我不确定这是一个错误还是背后有原因,但这就是它在 Access 2007 中的工作方式 - 至少对我来说是这样.
The form recordsource needs to be a query - no sql code, no "select * from query", just the name of a query. Anything else leads to the fact that you are limited in using the filters. I'm not sure if this is a bug or if there is a reason behind this, but that's the way it works in access 2007 - at least for me.
在我向查询中动态添加条件之前,这导致了select * from qDeliveries where location = 1"之类的记录源.为了实现这一点,我现在只创建一个临时查询,它是表单记录源,而不是仅使用 sql 代码.
Before I was dynamically adding conditions to my queries which led to a recordsource like "select * from qDeliveries where location = 1". To accomplish this I now just create a temporary query which is the form recordsource instead of just using the sql code.
希望这可以帮助任何人... :)
Hope this helps anyone... :)
这篇关于设置第一个过滤器后,访问过滤器不会显示可供选择的值列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!