Link to home
Start Free TrialLog in
Avatar of bill201
bill201

asked on

how to prevent user to delete a specific record on a continuous form in microsoft access 2013

i use this code to try prevent user from delete a record that is locked but it's doesn't prevent to delete, what is wrong with this code?

this is my code:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
If Me.Locked = True Then
    MsgBox "not able to delete a closed record"
    Cancel = True
End If
End Sub

Open in new window

Avatar of Nuno Rogado
Nuno Rogado
Flag of Portugal image

Hi,

Change to:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
If Me.Locked Then
    MsgBox "not able to delete a closed record"
    Cancel = True
End If
End Sub
Avatar of bill201
bill201

ASKER

thanks
but it's not solved the problem
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bill201

ASKER

thanks alot