Cascading delete messages

R

Robert

I would like to disable the Access message for confirming a cascading
delete and replace it with a custom message box. I put the code for the
delete button between the following statements:

DoCmd.SetWarnings False
DoCmd.SetWarnings True

This doesn't seem to work and would greatly appreciate any suggestions.

Thanks, Rob
 
A

Allen Browne

Rob, it would be helpful to know what the delete code is.

If you are using something like
RunCommand acCmdDeleteRecord
this will trigger the BeforeDelConfirm event of the form. You can use that
event to show your own custom MsgBox, and set the Response argument to
suppress the built-in one.

If you are running a Delete query, see:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html
 
Top