Answer "Yes" when delete a record

L

Luis Marques

I have the following code, to delete a record. But before access delete it,
needs a confirmation (yes/no).

What code do I need, to always answer yes?

DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, acDelete, , acMenuVer70

Thanks in advance
 
D

Dennis

The following will do it without the prompt

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, acDelete, , acMenuVer70
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

Top