asking before deleting record

lakshmi

New member
Local time
Today, 21:11
Joined
Apr 26, 2000
Messages
7
Is it possible to modify a form that if a user is going to delete a record, it can questions it? If so, how?

Thank you.
 
Use the On Delete event. Ex:

Code:
Private Sub Form_Delete(Cancel As Integer)
If UserAccessLevel =1 Then 'If the user is an Administrator
    If MsgBox("Please, confirm if you want to delete the present contract.", _
              vbExclamation + vbOKCancel, "Delete Conntract") <> vbOK Then
        DoCmd.CancelEvent
    End if
End if

Hope this helps

Alex

[This message has been edited by Alexandre (edited 02-21-2002).]
 
I never let anybody delete anything unless I get it in triplicate six months in advance of said deletion.

I have a "deleted" check box as part of the record in my table. This is triggered on my form by a "Delete" command button which checks the box. All my forms, queries etc are set to not show anything checked "deleted".

Every so often I move the "deleted" files to archive, just in case.

I also have a Restore button on an Admin form that magically brings back the record when somebody realised they've mucked up and shouldn't have deleted the record in the first place.

If your not worried about the space then it's worth considering.

[This message has been edited by DBL (edited 02-21-2002).]
 

Users who are viewing this thread

Back
Top Bottom