如果我再检查一个是否可以强制选中是/否框? [英] How can I force a yes/no box to become checked if I check another one?

查看:46
本文介绍了如果我再检查一个是否可以强制选中是/否框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好! (MS Access 2007表格)


我有三个是/否(复选框)字段用于注册:

1.全年(9月 - 5月)

2.第一学期(9月至12月)

3.第二学期(1月至5月)


当然,如果他们注册和支付全年,我希望第一学期和第二学期复选框自动检查自己。如果他们不是,我希望能够检查其中一个或两个。


我尝试过使用iff:


= IIf([全年] =真,-1,0)


但我不知道该把它放在哪里。如果我把它放入控制源,我就失去了自己检查第一个术语或第二个术语框的能力,而且它也不再与人存储(这很重要)。


我确定它非常简单......有什么想法吗?

Hello! (MS Access 2007 form)

I have three yes/no (check box) fields for registration:
1. Full year (Sept-May)
2. 1st term (Sept-Dec)
3. 2nd term (Jan-May)

Of course, if they register and pay for the full year, I would like the 1st term and second term check boxes to automatically check themselves off. If they don''t, I want to be able to check one or the other or both.

I''ve tried using an iff:

=IIf([Full Year]=True,-1,0)

but I''m not sure where to put it. If I put it into the Control Source, I lose the ability to check the 1st term or second term box by itself, and also it ceases to be stored with the person (which is important).

I''m sure it''s exceedingly simple...any ideas out there?

推荐答案

将你的代码放在复选框的afterupdate事件中控制其他复选框。这样,只要该控件更新并且您将控件(选项卡转到下一个控件),代码就会执行。


Jim
Put your code in the afterupdate event of the checkbox that controls the other checkbox(es). That way, as soon as that control is updated and you leave the control (tab to the next control) the code is executed.

Jim


谢谢!尝试把它放入更新后:


= IIf([全年] = - 1,[第一学期] = - 1,[第一学期] = 0)


我尝试过使用True,False,Yes,No,一切。什么都没发生。我也尝试将它放入第一学期框的Beforeupdate。什么都没发生呢!如果SOMETHING发生了我会很高兴,所以我可以调试!


很抱歉这样一个菜鸟......你能为我愚蠢吗?谢谢! :)
Thanks! Tried putting this into the afterupdate:

=IIf([Full Year]=-1,[1st semester]=-1,[1st semester]=0)

I''ve tried using True, False, Yes, No, everything. Nothing happens. I also tried putting it into the Beforeupdate of the 1st semester box. Nothing happened then either! I''d just be happy if SOMETHING happened, so I could debug!

Sorry to be such a noob...could you dumb it down for me even more? THANKS! : )


:)是的,我理解你的挫败感。它应该是
:) Yes, I understand your frustration. It should be
展开 | 选择 | Wrap | 行号


这篇关于如果我再检查一个是否可以强制选中是/否框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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