Check boxes Lock/Enable etc question

  • Thread starter Thread starter sealux
  • Start date Start date
S

sealux

I know MS Access pretty well, but I am a complete novice at coding. I
am working on a database that has 1 checkbox that once it is checked it
can not be unchecked. They want the rest of the fields to be editable
besides this one.

I am trying to run the following code on the OnClick command of the
checkbox, but I know it is hosed up somehow. For entries that have
been checked, they can't be edited, which is what I want, but if I want
to check something, it won't let me.

Help would be most appreciated. Thanks! :)

Private Sub NeedsReview_Click()
If NeedsReview = True Then
NeedsReview.Locked = True
End If
End Sub
 
you need to run code in the form's Current event, so that as you move from
record to record in the form, the checkbox control is locked/unlocked
appropriately, as

Me!NewsReview.Locked = Me!NeedsReview

if the value of NeedsReview is True, then Locked = True, and vice versa.

btw, you can also replace your Click event code with the above code on the
NeedsReview control's AfterUpdate event.

hth
 
Back
Top