Locking a record

M

Mellie

Hello

My goal is to lock records once a check box is checked. The question is:
Completed yes or no? Once the yes is check I want that record to be locked
from editing. There is no subform right now. Do I need to create a subform
or can it be locked with out the subform?
Thanks
 
N

NetworkTrade

there is more than one way to do this; and there is some tricky aspects
depending on how you percieve the overall user experience is to be
"managed"....

can one do the equivalent of locking all fields by putting the form's 3 key
controls to false
AllowEdits
AllowAdditions
AllowDeletions


Setting these form properties to False may accomplish your goal, but they
also affect whether new records can be shown and whether any records are
shown.
 
L

Linq Adams via AccessMonster.com

A subform has nothing to do with this.

This code will do the trick:

Private Sub Form_Current()
If Me.CompletedCheckBox = -1 Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If
End Sub

Once the checkbox is checked and you move off of the record or close the form,
the record will be locked. Keep in mind that you need to have a strategy for
correcting mistakes. It can a separate form for making corrections which is
only available to a supervisor/administrator type person, or access by the
same type person to the underlying table (not really recommended) but you
have to have some way available.
 
Top