复选框选择其他复选框 [英] Checkbox selects other Checkboxes
问题描述
大家好,
[Access 2003]
我有一个质量保证数据库,其表格上有一堆复选框这就是为什么产品没有通过检验的理由。
这是因为用户可以选择单独的复选框来指明原因。我想知道怎么做的是在表格上放一个复选框或单选按钮,如果它被选中,将选中所有复选框。
当我添加一个复选到我的表单并尝试为其编写代码,控件没有值或已检查属性供我选择。是不是可以这样做?如果我使用一个单选按钮,我希望有一个全选和一个取消选择,如果可能的话。
我试过了根据我在网上找到的东西无效:
Hi everybody,
[Access 2003]
I have a quality assurance database that has a form with a bunch of checkboxes on it that serve as reasons for why a product didn''t pass inspection.
It''s a given that the users will be able to select individual checkboxes to indicate the reasons. What I would like to find out how to do is to put a checkbox or radio button on the form that will select all the checkboxes if it''s selected.
When I added a checkbox to my form and tried to write code for it, the control didn''t have a ''Value'' or ''Checked'' property for me to choose. Is it not possible to do this? If I use a radio button, I''d like to have one to ''Select All'' and one to ''Deselect'' if at all possible.
I tried the following to no avail based on something I found online:
推荐答案
嗨OldBirdMan,
这是我为全选复选框输入的代码。我不认为这很重要,但是复选框都在选项卡控件上。
Hi OldBirdMan,
Here''s the code I entered for my ''Select All'' checkbox. I don''t think it matters, but the checkboxes are all on a tab control.
嗨OB。很高兴再次见到你:)
假设OB在他的示例中显示的聪明的命名结构(所有CheckBox控件,只有CheckBox控件,启动chk)以及chkSelectAll& chkDeselectAll是唯一以最后三个字符All结尾的,然后以下代码应该有所帮助:
Hi OB. Good to see you around again :)
Assuming the clever naming structure that OB displays in his example (All CheckBox controls, and only CheckBox controls, start chk) and also that chkSelectAll & chkDeselectAll are the only ones ending in the last three characters "All", then the following code should help somewhat :
这篇关于复选框选择其他复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!