delete record message

  • Thread starter Thread starter laura
  • Start date Start date
L

laura

Is there any way to NOT use the standard Access message that says:-

"You are about to delete 1 Record(s)
If you click yes.... "

Basically I am allowing users to use the X (delete) button on the toolbar to
delete a record. I have some coding that checks some of the data before
allowing the record to be deleted in the procedure "Private Sub
Form_Delete(Cancel As Integer)" but I cannot get rid of that message, even
with DoCmd.SetWarnings False.

Would I have to write my own delete procedure in order to not have that
message come up? If so can I have an example of how to delete the current
record?

Laura TD
 
Go to Tools~Options~Edit/Find (in Access2K)
uncheck "Actions Queries" in the "Confirm" panel

To run an action query (insert, update, delete) from code
use the general form
 
Chris,

Unchecking "Actions Queries" in the "Confirm" panel is very bad practice! One
could easily delete records somewhere without any warning.

To delete the current record, the poster could put the following code in the
DblClick event of one of the fields:
DoCmd.SetWarnings False
DoCmd.RunCommand acDeleteRecord
DoCmd.SetWarnings True
 
Back
Top