lock records using option buttons

B

bpolite

I have a subform with the following fields:

Item
Location
Price
Description
Comments
Date Modified
Time Modified
Comments
Decision

The Decision field is linked to an option group with 3 check boxes labeled
Accepted,Declined and Rejected. Is there a way to lock an individual record
after one of the check boxes have been chosen so that the information cannot
be edited? Then unlock the record in a password protected way so the
information can again be edited? I would really appreciate some help with
this issue.

Thanks So Very Much
bpolite
 
P

pietlinden

I have a subform with the following fields:

Item
Location
Price
Description
Comments
Date Modified
Time Modified
Comments
Decision

The Decision field is linked to an option group with 3 check boxes labeled
Accepted,Declined and Rejected. Is there a way to lock an individual record
after one of the check boxes have been chosen so that the information cannot
be edited? Then unlock the record in a password protected way so the
information can again be edited? I would really appreciate some help with
this issue.

Thanks So Very Much
bpolite

You can change the AllowEdits property of the subform when the option
group is updated. You would need to re-evaluate the "rule" in the
OnCurrent event of your form, because you need to unlock the
individual records.

Private Sub cmdDisableEdits_Click()
Me.AllowEdits = Not (Me.AllowEdits)
Me.Requery
End Sub

Private Sub Form_Current()
If Not IsNull(Me.cboDecision) Then
Me.AllowEdits = (Me.cboDecision.Value = 1 Or
Me.cboDecision.Value = 2 Or Me.Decision.Value = 3)
End If
End Sub
 
Top