Locking specific records

A

Amir

Hi,
I have a form that brings up records that are already
created, thay can't add any records or edit them. I would
like to lock specific records from being deleted based on
checkbox; I have a checkbox called chkLocked. I wanna be
able to say if this check box has value of true(-1) then
this records can't be deleted. This form is continuous
form if it makes difference. They should be able to delete
records that chkLock is set to 0.
Thank you in advance.
 
P

Peter Hoyle

Hi,

You could use something like

Private Sub Form_BeforeDelConfirm(Cancel As Integer, _
Response As Integer)
If chkLocked Then
Cancel = True
MsgBox "This record cannot be deleted."
End If

End Sub

Cheers,
Peter
 
A

Amir

Thank you ,,,
that will do.
-----Original Message-----
Hi,

You could use something like

Private Sub Form_BeforeDelConfirm(Cancel As Integer, _
Response As Integer)
If chkLocked Then
Cancel = True
MsgBox "This record cannot be deleted."
End If

End Sub

Cheers,
Peter





.
 

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