Update (courtesy of Access MVP A.D. Tejpal)
Apparently, the OP wishes to ensure that for certain category of
records, the check box on a continuous form should be non-editable. This
objective can be met by manipulating the locked property alone, without
disturbing the enabled property, which can remain permanently true.
In fact trying to manipulate the enabled property of check box would not
even be desirable, as any such command becomes ineffective on a direct click
(a control having focus can not be disabled).
Enter event of check box fires before its click and AfterUpdate events.
As such this event can be used directly, in lieu of form's current event.
Sample code in enter event of check box named ChkDiscontinued, as given at
(A) below, should get the desired results.
PClass is the name of field identifying the records where such locking
is to be enforced (in sample case, PClass = "D" is the criteria).
Simultaneously, such records can be specially highlighted via conditional
formatting, using the expression given at (B) below.
Best wishes,
A.D.Tejpal
--------------
(A) Code in form's module
================================
Private Sub ChkDiscontinued_Enter()
If Me.PClass = "D" Then
Me.ChkDiscontinued.Locked = True
Else
Me.ChkDiscontinued.Locked = False
End If
End Sub
================================
(B) Expression for conditional formatting
================================
[PClass]="D"
================================
Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html