473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Stop Delete confirmation Box from displaying

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
3 8008
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: chris | last post by:
is there a way in either php or html to disable the back and or the reload/refresh on a browser so a potential spammer cant just keep refreshing the page of a form that sends a confirmation email...
4
by: Stephen | last post by:
Hello People, Using MS Access 2003 VBA I get the error 3020 Update or CancelUpdate without AddNew or Edit when I run through the following code. Can anyone help suggest anything to try? Thanks....
6
by: Dotnet Guy | last post by:
I want to add a confirmation dialog box before I delete the records in my form. I have a piece of javascript code in html that checks for confirmation. But the main issue lies in calling this...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
4
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on...
0
by: Elton W | last post by:
Hi Peter, You use DeleteButton.Attributes.Add("onclick", "return confirm ('Are you sure you want to delete?');"); in datagrid_ItemDataBound event to add confirmation for delete button.
0
by: Suzanne | last post by:
I'd like to know how can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key? I have found this code on...
0
by: johnmott | last post by:
Hi all, One of the limitations of the GridView control is that the built-in delete processing doesn't prompt for confirmation -- something thats very important for a user interface. True, you...
0
by: Eraser | last post by:
Hi to all .NET guru guys... I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.