Locking a record via a form

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
 
R

RonaldoOneNil

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top