报告过滤:如何管理100个过滤器? [英] Report Filtering: How do I Manage 100s of Filters?

查看:75
本文介绍了报告过滤:如何管理100个过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与此中的相同数据直接相关发布

场景:

我正在尝试创建一个表单,允许我在非常精细的级别过滤数据集。为此,我需要能够单独选择记录及其子记录,记录数量略多于250.

可能的解决方案:

现在我正在想要创建一个未绑定的组合框,它将选择一系列记录(平均大约20个左右)并显示它们以被选为复选框。因此理论上你会选择一个系列,并且动态填充复选框以允许选择,然后当你更改系列时,它会将选择写入内存,构建过滤器。

伪代码:
用户选择Family

展开 | 选择 | Wrap | 行号

推荐答案

如果您打算在连续表单上放置一堆未绑定的复选框,以便您选择要使用的记录,您会感到失望。 Access仅在将其放置在窗体上时创建一个未绑定控件的实例。它会多次绘制它,但它实际上是反复绘制的相同实例。这意味着当您选中复选框时,它将检查表单上的所有控件。取消选中也是如此。


我认为使用数组来存储选定的值会使您受益。显示连续表单中具有按钮的记录列表,单击该按钮时,将当前主键插入阵列。然后你可以编写一个VBA例程,使用 IN()
If you are planning on putting a bunch of Unbound Checkboxes on a Continuous Form to allow you to select which records to use, you are going to be disappointed. Access only creates one instance of an Unbound control when it places it on the Form. It will paint it multiple times, but it is essentially the same instance painted over and over. Which means when you check the Checkbox, it will check it for all controls on the Form. Same goes for Unchecking.

I think you would benefit by using an Array to store the selected values. Show a list of records in a Continuous Form that have a Button that when clicked, inserts the current Primary Key into the Array. Then you can write a VBA routine that converts the Array to a Where Clause utilizing IN()


也可以使用tempvars集合沿与数组相同的行添加主键。完成后,通过集合迭代以构建where条件。这里的优点是如果出现错误,选择将被保留,并且可以直接在查询或其他表单中使用。


可以使用列表框并使用add方法插入PK列中的人文友好信息。然后迭代通过列表框项来构建条件。这里的优点是可以包含从列表中删除所选项目的逻辑。


非常难以确定您追求最终产品的确切内容。


每个家庭记录是否有最大数量的项目?


您是否只想在更换家庭时查看每个家庭的选择?
Could also use the tempvars collection to add the primary key along the same lines as the array. Once done then iterate thru the collection to build the where condition. Advantage here is that if there is an error the selections are retained and can be used directly in the query or other forms.

Could use a listbox and use the add method to insert the PK and human friendly information in columns. Then iterate thru the listbox items to build the conditional. Advantage here is that one could include logic to remove a selected item from the list.

Really difficult to determine what it is exactly that you are after for the end product.

Is there a maximum number of items to be selected per family record?

Do you only want to see the selections for each family as you change family?


您能否发送您想要的数据样本?搜索和你想得到的结果(我意识到这可能都是伪数据)?


Phil
Can you send a sample of the data you want to search and the results you want to get (I realise this may all be pseudo data)?

Phil


这篇关于报告过滤:如何管理100个过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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