Locking Form and Subform-What am I doing wrong?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay, I have a form that includes a checkbox "Closed_Check", when this box is
checked I need to lock that specific record in the form and subform.
Currently I've tried:

If Closed_Check = True Then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If

and placed this in the On Current event field for both the form and subform.
It works, problem is it locks the following records that are not closed.

What am I missing?
HELP
 
then what is a person to do?
I have the check box there for when an item is closed (naturally to stop
someone from editing by mistake)
The form is a single form view and the subform is a datasheet. They are
linked by a JEID#.
 
Put that code in the form's Current event.

Yes, that will either lock every row or unlock every row. However, you can't
change a row unless it's the active row, and putting the code in the Current
event insures that whether or not the form is locked depends on the current
row.
 
Back
Top