Warning before record deletion

  • Thread starter Thread starter CW
  • Start date Start date
C

CW

I need to give users the ability to delete certain records. I shall give them
a command button that will open a form where they will have only limited
access so they cannot do too much damage.
As a safety measure before the form is actually displayed, when they click
on the Delete button I want to have a popup warning them that they are about
to permanently delete a record, and incorporating OK and Cancel buttons.
Clicking on OK would open the form where they can select and delete a record.
Clicking on Cancel would (surprise, surprise) clear the popup and take them
back whence they came.
I have some vague ideas how to do this but would appreciate some advice,
please.
Many thanks
CW
 
In the event procedure of the delete button click put this

Dim nAns as Integer

nAns = Msgbox("Are you sure you want to
delete?",vbInformation+vbYesNo,"Confirm Deletion")
If nAns = vbYes then
docmd.openform "etc etc
End if
 
Many thanks - I'll give that a try
CW

RonaldoOneNil said:
In the event procedure of the delete button click put this

Dim nAns as Integer

nAns = Msgbox("Are you sure you want to
delete?",vbInformation+vbYesNo,"Confirm Deletion")
If nAns = vbYes then
docmd.openform "etc etc
End if
 
Back
Top