473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.BeforeDelCon firm = "Form_BeforeDel Confirm"
DoCmd.RunSQL "Delete from Offersheet"
How can I stop this message from showing programmaticall y.
I know I can uncheck the Record Changes Box in the edit/Find in the options
dialog but I want to do this programmaticall y.

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

Thanks for your help.
Nov 12 '05 #1
3 8024
A couple of options.

1) Use DoCmd.SetWarnin gs to turn off the warnings.

2) Use a different syntax to run the SQL

CurrentDb.Query Defs("Delete from Offersheet").Ex ecute dbFailOnError

--
Wayne Morgan
Microsoft Access MVP
"John Galt" <js**@yahoo.com > wrote in message
news:UE******** ************@ne ws1.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.BeforeDelCon firm = "Form_BeforeDel Confirm"
DoCmd.RunSQL "Delete from Offersheet"
How can I stop this message from showing programmaticall y.
I know I can uncheck the Record Changes Box in the edit/Find in the options dialog but I want to do this programmaticall y.

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******** *********@newss vr31.news.prodi gy.com...
A couple of options.

1) Use DoCmd.SetWarnin gs to turn off the warnings.

2) Use a different syntax to run the SQL

CurrentDb.Query Defs("Delete from Offersheet").Ex ecute dbFailOnError

--
Wayne Morgan
Microsoft Access MVP
"John Galt" <js**@yahoo.com > wrote in message
news:UE******** ************@ne ws1.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.BeforeDelCon firm = "Form_BeforeDel Confirm"
DoCmd.RunSQL "Delete from Offersheet"
How can I stop this message from showing programmaticall y.
I know I can uncheck the Record Changes Box in the edit/Find in the

options
dialog but I want to do this programmaticall y.

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.Execu te strSQL,dbfailon error command instead of
docmd.runsql. For ADO use CurrentProject. Connection.Exec ute strCommand,
lngRecordsAffec ted, adCmdText

If you're going to use docmd.setwarnin gs 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.execu te 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
15586
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 out thanks in advance
4
9400
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. On Error GoTo delete_failed Dim RS_DEL As DAO.Recordset
6
1659
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 javascript function on pagebehind. function confirm_delete() { if (confirm("Are you sure you want
3
2777
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, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts:...
4
3024
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 that page. Each row in each datagrid includes a Delete button (added at runtime by the code-behind page as a ButtonColumn) and an Edit button...
0
2679
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
2252
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 a windows forms FAQ site : Public Class DataGrid_Custom Inherits DataGrid Private Const WM_KEYDOWN = &H100
0
1993
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 can add server side logic for this, but its much more reassuring to have a Javascript confirmation window open up and prompt. There are several...
0
2794
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. What happened is if I select cancel on my confirmation button, it executes the griedview postback which i assigned in my code behind. Please see my...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.