I think this is the nature of a CheckBox in that the act of getting focus
changes it so BeforeUpdate kicks in whilst the box still has the focus.
Cancel = True then resets it this triggers another BeforeUpdate event as
soon as focus goes to another control control and so-on.
So basically you can't use Before Update for this.
But do I gather that my previous suggestion won't work because you are
sharing the same 'front end' with multi-users? This isn't a good idea. You
should split the database into a data file that you share and a separate
front end for each user.
If you really don't want to do this then try the Mouse Down event
If <Your Terms> Then
MsgBox "You can't change this "
Me.Checkbox.Locked = True
Else
Me.Checkbox.Locked = False
End If
(You can't disable it as it has the focus)
HTH
"alekm" <(E-Mail Removed)> wrote in message
news:1EBC1586-8141-45CE-9BB9-D6E2
(E-Mail Removed)...
>I don't want to disable check box because there are users allowed to change
> it. There are user who are not to allowed to change its state . I want to
> check them in before update event and if user is not allowed changing
> check
> box I want to put there Cancel = true.
> The questio is: As soon Cancel = true is executed I fall in loop. Event
> procedure is execute over and over again. Why is that?
>
> "Jon Lewis" wrote:
>
>> That's exactly what Enabled does. If .Enabled = True the check box is
>> greyed out and you can't change it.
>>
>> If the context is a single form view Form then use the Current Event for
>> the
>> code
>>
>> > If <certain terms> Then
>> > Checkbox.Enabled = False
>> > Else
>> > Checkbox.Enabled = True
>> > End If
>>
>> If the conditions change (e.g. you update another control) use the
>> relevent
>> After Update event to set the Enabled state of the Check Box.
>>
>> HTH
>>
>>
>> "alekm" <(E-Mail Removed)> wrote in message
>> news:531544A2-58EF-433A-8B8A-(E-Mail Removed)...
>> > And I'm looking to disallow change of a check box state not to set it
>> > based
>> > on certain terms
>> >
>> > "Stuart McCall" wrote:
>> >
>> >> "alekm" <(E-Mail Removed)> wrote in message
>> >> news:F93CDF14-4896-46CE-9FB5-(E-Mail Removed)...
>> >> > Hi,
>> >> > if the check box is clicked how can I disallow change of its state
>> >> > based
>> >> > on
>> >> > certain terms...
>> >> > Thanx
>> >> >
>> >> > alekmil
>> >>
>> >> If <certain terms> Then
>> >> Checkbox.Enabled = False
>> >> Else
>> >> Checkbox.Enabled = True
>> >> End If
>> >>
>> >> It's best to do this before the checkbox is clicked (say the lostfocus
>> >> event
>> >> of the previous control or something like that)
>> >>
>> >>
>> >>
>> >> .
>> >>
>>
>>
>> .
>>