Msg Box

D

Dave Hawks

I want to use code to prevent the unauthorised deletion of a record.
I use the following Triggered by the on current event to lock existing
records whilst allowing new records.
If IsNull(FieldName) Then
Me.FieldName.Locked=False
Else
Me.FieldName.Locked = True
End If

In the event that it is true I would like to display a message Box advising
the user that they must enter a security code to delete the entry, and then
if the code is valid reset the FieldName .Locked to False.
Can anyone suggest some suitable code.
Thanks
 
J

John Vinson

I want to use code to prevent the unauthorised deletion of a record.

I'd suggest using code in the BeforeDeleteConfirm event. If you set
Cancel to true in this event (with an appropriate warning msgbox to
the user) the deletion will not take place.

John W. Vinson[MVP]
 
Top