问题描述
我在Access 2007中有一个名为Leadership Contact List的连续表单。它具有每个记录的复选框控件(绑定到基础表中的字段),用于通过电子邮件发送或为选定的联系人创建邮件标签。在表单标题中,有一个?Select All?复选框控件(当然)选择所有复选框。表单还在标题中有一个组合框,根据?代理类型过滤记录。
我想要的是创建标签或仅通过电子邮件发送过滤集中的选定联系人,并可选择使用选择一次选择所有联系人所有的"控制。
?选择全部?效果很好,直到表格被过滤。背后的代码?选择全部?继续将所有复选框设置为true,即使它们没有在表单中显示。那么当?电子邮件选择联系人?或?为所选联系人创建邮件标签?单击按钮,结果根本不会被过滤。
我试图在On Click事件的SQL语句中的Where子句中添加其他条件以考虑过滤器,但是我得到错误?参数太少。预计1? (错误#3061)。我不知道是不是因为我的语法有问题,或者因为我试图做一些我能做的事情?
这里的代码是有效的:
I have a continuous form in Access 2007 called ?Leadership Contact List.? It has a checkbox control for each record (bound to a field in the underlying table) that is used to email or create mailing labels for the selected contacts. In the form header, there is a ?Select All? checkbox control which (of course) selects all the checkboxes. The form also has a combo box in the header that filters the records according to ?agency type.?
What I want is to create labels or email only selected contacts within the filtered set, with the option to select them all at once using the "Select All" control.
The ?Select All? works great, until the form is filtered. The code behind ?Select All? continues to set all the checkboxes as true, even if they aren?t showing in the form. So when the ?Email Selected Contacts? or ?Create Mailing Labels for Selected Contacts? buttons are clicked, the results are not filtered at all.
I have tried to add additional criteria to the Where clause in the SQL statement of the On Click event to account for the filter, but I get the error ?Too few parameters. Expected 1? (error #3061). I don?t know if it?s because I have the syntax wrong or because I?m trying to do something I can?t.
Here?s the code that works:
推荐答案
这篇关于过滤器无法使用“全选”复选框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!