Locking specific records

  • Thread starter Thread starter Amir
  • Start date Start date
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.
 
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
 
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





.
 
Back
Top