Warning before record deletion

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
 
R

RonaldoOneNil

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
 
C

CW

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top