delete record message

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
 
C

Chris

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
 
P

PC Datasheet

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
 

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

Similar Threads


Top