By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

Stop Delete confirmation Box from displaying

P: n/a
I am trying to stop the Delete confirm message from showing up on a delete
of all records in a table.
The code (THAT IS NOT WORKING) is:

Me.BeforeDelConfirm = "Form_BeforeDelConfirm"
DoCmd.RunSQL "Delete from Offersheet"
How can I stop this message from showing programmatically.
I know I can uncheck the Record Changes Box in the edit/Find in the options
dialog but I want to do this programmatically.

Please post here or write me at js**@yahoo.com

Thanks for your help.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
A couple of options.

1) Use DoCmd.SetWarnings to turn off the warnings.

2) Use a different syntax to run the SQL

CurrentDb.QueryDefs("Delete from Offersheet").Execute dbFailOnError

--
Wayne Morgan
Microsoft Access MVP
"John Galt" <js**@yahoo.com> wrote in message
news:UE********************@news1.epix.net...
I am trying to stop the Delete confirm message from showing up on a delete
of all records in a table.
The code (THAT IS NOT WORKING) is:

Me.BeforeDelConfirm = "Form_BeforeDelConfirm"
DoCmd.RunSQL "Delete from Offersheet"
How can I stop this message from showing programmatically.
I know I can uncheck the Record Changes Box in the edit/Find in the options dialog but I want to do this programmatically.

Please post here or write me at js**@yahoo.com

Thanks for your help.

Nov 12 '05 #2

P: n/a
Wayne,

Thank you very much!
That worked like a charm.

John Galt
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:g5*****************@newssvr31.news.prodigy.co m...
A couple of options.

1) Use DoCmd.SetWarnings to turn off the warnings.

2) Use a different syntax to run the SQL

CurrentDb.QueryDefs("Delete from Offersheet").Execute dbFailOnError

--
Wayne Morgan
Microsoft Access MVP
"John Galt" <js**@yahoo.com> wrote in message
news:UE********************@news1.epix.net...
I am trying to stop the Delete confirm message from showing up on a delete of all records in a table.
The code (THAT IS NOT WORKING) is:

Me.BeforeDelConfirm = "Form_BeforeDelConfirm"
DoCmd.RunSQL "Delete from Offersheet"
How can I stop this message from showing programmatically.
I know I can uncheck the Record Changes Box in the edit/Find in the

options
dialog but I want to do this programmatically.

Please post here or write me at js**@yahoo.com

Thanks for your help.


Nov 12 '05 #3

P: n/a
"John Galt" <js**@yahoo.com> wrote:
I am trying to stop the Delete confirm message from showing up on a delete
of all records in a table.


To expand on Wayne's posting.

I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror command instead of
docmd.runsql. For ADO use CurrentProject.Connection.Execute strCommand,
lngRecordsAffected, adCmdText

If you're going to use docmd.setwarnings make very sure you put the True statement in
any error handling code as well. Otherwise wierd things may happen later on
especially while you are working on the app. For example you will no longer get the
"Do you wish to save your changes" message if you close an object. This may mean
that unwanted changes, deletions or additions will be saved to your MDB.

Also performance can be significantly different between the two methods. One posting
stated currentdb.execute took two seconds while docmd.runsql took eight seconds. As
always YMMV.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.