From: John W. Vinson on
On Fri, 14 May 2010 12:52:23 -0500, Rick Brandt <rickbrandt2(a)hotmail.com>
wrote:

>John W. Vinson wrote:
>> If you don't want a user to check a checkbox, don't LET them check it in
>> the first place!
>>
>> Try putting code in the Form's Current or Load event:
>>
>> Me!MyCheckbox.Enabled = (CurrentUser = "RightUser")
>
>I'm assuming that this would be the proper method according to standard UI
>practice, but in my experience disabling a control is likely to generate a
>support call of "why is this control disabled?" whereas using BeforeUpdate
>to display a message explaining why they are not allowed to use that control
>does not.
>

I should have added that setting its Visible property to no might be even more
effective: the user won't complain about being unable to click a checkbox if
they can't even see it!

Good point though. If it's important that the box be visible but protected,
the BeforeUpdate event would indeed be less user hostile.
--

John W. Vinson [MVP]
From: BruceM via AccessMonster.com on
I know you acknowledged you were incorrect about the Before Update event for
a single check box, but I want to point out that my tests with Access 2003
show that updating the check box from code in its own After Update event as
you showed does indeed trigger its After Update event again. However, if you
update CheckBoxA from After Update code in CheckBoxB, the After Update code
of CheckBoxA will not run. It is only when you update CheckBoxA with its own
After Update event that the code runs again and again.

Krzysztof Naworyta wrote:
>Juzer BruceM via AccessMonster.com <u54429(a)uwe> napisał
>
>| A check box as an option group control does not have Before Update, but
>| a single check box bound to a table field does.
>
>You are wrong :)
>Single checkbox can have BeforeUpdate subrutine but it does not work!
>You can not take OldValue for example. You can not cancel this event.
>
>| If you use the After Update event as you have shown the value will be
>| updated, and the After Update code will run again, which means the
>| value will be updated, and the After Update code will run again....
>| The user will be able to do nothing but click the message box button
>| over and over.
>
>You are wrong!
>Updating any control from code NEVER triggers AfterUpdate event.
>

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1

From: Krzysztof Naworyta on
BruceM via AccessMonster.com wrote:


(...)
| I want to point out that my tests
| with Access 2003 show that updating the check box from code in its
| own After Update event as you showed does indeed trigger its After
| Update event again.

I can not confirm it!

--
KN