Locking a record via a form

  • Thread starter Thread starter Tony F
  • Start date Start date
T

Tony F

Using Access 2000.
I wish to lock each record in my database using a checkbox (Approved) on a
form. I have the following code and form properties but am still able to edit
the data when the checkbox is ticked.
Can you tell me where I am going wrong?

Private Sub APPROVED_AfterUpdate()
If chkAPPROVED = True Then
Me.AllowEdits = False
Me.AllowDeletions = False
End If
End Sub

Private Sub Form_Current()
If chkAPPROVED = True Then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True

End If
End Sub

Allow Edits = no
Allow Deletions = no
Data entry = no
Record locks = All Records

Thanks in advance for any help you can give
 
You seem to have a naming problem. Is the Checkbox called Approved or
chkApproved ?
You have an Approved After Update Event but then are checking if chkApproved
is ticked.
 
Back
Top