Update Query Warning Message

I have a macro that will import a series of text files and then perform some 
Delete Queries...how can I stop the warning box that comes up and notifies 
you that you are about to delete records from your table?

Thanks!


0
John
10/26/2007 8:36:00 PM
access 16762 articles. 1 followers. Follow

4 Replies
1707 Views

Similar Articles

[PageSpeed] 30

On Fri, 26 Oct 2007 15:36:00 -0500, John W wrote:

> I have a macro that will import a series of text files and then perform some 
> Delete Queries...how can I stop the warning box that comes up and notifies 
> you that you are about to delete records from your table?
> 
> Thanks!

Using Macro's?

Macro SetWarnings False
Macro Run Query "Delete Query Name"
Macro SetWarnings True

Using code, it would be:

DoCmd.SetWarnings False
DoCmd.OpenQuery "QueryName"
DoCmd.SetWarnings True
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
10/26/2007 8:49:59 PM
There are a couple of ways you can do this.  

Calling the queries by using CurrentDb.Execute will work as well as using 

DoCmd.SetWarnings False
...do your queries
DoCmd.SetWarnings True

but if you do that, be sure to have an error handler and put the 
DoCmd.SetWarnings True in the first line of your error handler or else you 
might find yourself without warnings at all.
-- 
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.


"John W" wrote:

> I have a macro that will import a series of text files and then perform some 
> Delete Queries...how can I stop the warning box that comes up and notifies 
> you that you are about to delete records from your table?
> 
> Thanks!
> 
> 
> 
0
Utf
10/26/2007 8:50:01 PM
Thanks - I knew it had to be simple!

"fredg" <fgutkind@example.invalid> wrote in message 
news:1owzq0lrqc4vk$.7cieyaer4gqa$.dlg@40tude.net...
> On Fri, 26 Oct 2007 15:36:00 -0500, John W wrote:
>
>> I have a macro that will import a series of text files and then perform 
>> some
>> Delete Queries...how can I stop the warning box that comes up and 
>> notifies
>> you that you are about to delete records from your table?
>>
>> Thanks!
>
> Using Macro's?
>
> Macro SetWarnings False
> Macro Run Query "Delete Query Name"
> Macro SetWarnings True
>
> Using code, it would be:
>
> DoCmd.SetWarnings False
> DoCmd.OpenQuery "QueryName"
> DoCmd.SetWarnings True
> -- 
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail 


0
John
10/26/2007 9:23:11 PM
"John W" <jw2554@yahoo.com> wrote:

>I have a macro that will import a series of text files and then perform some 
>Delete Queries...how can I stop the warning box that comes up and notifies 
>you that you are about to delete records from your table?

Don't use Setwarnings, it's too dangerous.

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 weird
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
   Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
0
Tony
10/27/2007 3:45:57 AM
Reply:

Similar Artilces:

updating sheets based on data in first sheet
Another payroll question, I have a workbook that contains 26 sheets, one for each bi-weekl payroll period. I would like to set it up so when i add a new employe the rest of the sheets also update automatically with that employee name and information. I have been able to acheive this to a limited degree using th =sheet1!a1 formula, but this only updates the info in the first cel and particularly the first column. I would like to acheive this using the first sheet, since at th end of the year I would like to be able to calculate ytd figure easily. Thank -- Message posted from http://www.Exc...

Update for MS Money 2005?
I have Money 2005. Is there an update to MS Money for Canadian users? Thanks in advance for any answers. We need a bit more information! Are you having problems with M2005 or is this just a post-Christmas/New Year random query when you are trying to get away from the in-laws? -- Regards Bob Peel, Microsoft MVP - Money For unofficial FAQs see http://money.mvps.org/ or http://umpmfaq.info/ I do not respond to any emails that I have not specifically asked for. "Daniel" <Daniel@discussions.microsoft.com> wrote in message news:E86EAB89-21DE-4505-ACAD-647278D736BD@microso...

SBS2008
No matter what I do with my router, and I have tried 2 different ones, when I run the Setup your internet address wizard, enter my domain and se it to use mail.domain.com, i get a warning that the server cannot open ports 25, 80, 443, and 987. I am NOT actually running this wizard form the IP that is configured on the Domain's MX record. Is this why? When I bring the Server to the site where it will be implemented and run the wizard, will it complete when the MX points back to the IP that is correct for the Domain? Please advise. Also ... I am used to running localhost/e...

Problem with Script Updating
I am using a script to update the “1099 Type” field for Master Vendor table. The script basically is a basic if-then statement. This script is run “Before Document Commit” and it’s not updating correctly, its flip-flopping the results. When the script is set to run Before Document Commit I have the “Destination mapping” field “1099 Type” set to “Use Script”. Script below: If SourceFields("Send 1099") = "N" Then DestinationFields("Options.1099 Type").Value = 1 Else DestinationFields("Options.1099 Type").Value = 4 End If I have also tried this s...

Microsoft Update only updates Windows Defender
iacrosoft Update only updates Windows Defender - I have to use Belarc Advisor to get a list of missing updates, and then go to the Microsoft Download Center to search for the missing updates and download and install them one at a time. I have Windows XP Home SP3, with Microsoft Update set to automatic download - can anyone tell me why I do not get all the necessary upadtes? Is this a sudden, new problem? When was Automatic Updates last working? Can you update manually via http://windowsupdate.microsoft.com? Any chance you've got a beta build of WinXP SP3 installed? What...

Publisher 2007 and Microsoft Updates
I created a newsletter yesterday - everything fine - use Publisher all the time. Then an automatic update came down this morning and I can't open the file - it says "Publisher cannot open file" Other documents in Publisher are opening - any ideas? http://support.microsoft.com/kb/972566/ -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Kim" <Kim@discussions.microsoft.com> wrote in message news:8754339B-99DC-4D09-83AD-6B34D8215274@microsoft.com... >I created a newsletter yesterday - everythin...

Using Outlook 2002/Word 2002 - Mail Merge
Hi....we need to regularly send non-spam emails to 1000 ormore customers. We use Outlook 2002 and Word 2002. I understand that I can use mail merge with HTML format. I tested a pretty message using both HTML Format and Rich Text Format. HTML Format - after testing message with bold text, color text and underlined text the message is received lacking these pretty features and we see plain text only Rich Text Format - HTML Format - after testing message with bold text, color text and underlined text (to make it pretty), the message is received lacking these pretty features and we see plain tex...

Update question
Soory if this is the wrong place to ask this, but cannot find a NG proper to Windows 7. I currently run Windows Vista and am getting tired of Vista's decision to tell me that it is going to shut down in less than a minute. So have decided to upgrade to Windows &. I note that I can purchase an upgrade versiom for 64 quid from Amazon or an apparently full version of Windows 7 Home premium for 89 quid. My question is this - If I buy the upgrade version will I only be able to load it on a new PC in the future if I already have windows Vista installed? i.e For any future cl...

SELECT query as subquery to APPEND
I am trying to use a SELECT query as a subquery to an APPEND query to create a dynaset on the fly and append it into tblEmployeeProduction from the click of a button on a form. The only thing is that my SELECT query takes one parameter and because of that I am unsure how to set up the APPEND portion of the query or if it can be done at all. Here are the opening lines of the SELECT's SQL: PARAMETERS forms![frmSetEmpHours]![txtDate] DateTime; SELECT [FirstName] & " " & [LastName] AS Name, forms!frmSetEmpHours! txtDate AS ProductionDate, 'Do more stuff here.............

Db is corrupted ? "Can't open item" message.
Exchange 2000 Servers, two mailboxe servers, Symantec AV SMS 4.0 Recipients from both mailbox servers opening messages get message on Outlook 2002 "Can't open item" in 20% of their messages. Sporadic type of problem. Sometimes one user can open same message OK, other can't. I go to "Sent" items of user and sometimes "Can't open item" is displayed there. I accessed mailbox from affected user from Mailbox server (Outlook) and problem does reproduce Problem seems to start on Saturday. I didn't make any changes to Exchange The only recent change done ...

Outlook 2003 died mysteriously after update
Setup in a nutshell... System: Lenovo T500 laptop OS: Vista Business SP1 32-bit Software: Office Outlook 2003 SP3 Problem... So I'm using this setup for over a year, everything OK. Yesterday I did two things and now Outlook dies (quietly, sans error message) immediately after startup. It show the splash screen, displays my inbox, and *poof* disappears. What I did earlier... 1. Windows Update installed: KB9766662, KB979306, KB979099, KB975929 2. At the same time, while searching for another program to uninstall I stumbled upon (and uninstalled) Windows LIVE Toolbar and...

when I try to create a new email Outlook 2007 gives error message
I have just installed office 2007 upgrade, everything works well with the exception of Outlook 2007 when I click on "NEW" email, it gives me the following message: Microsoft office Outlook has encountered a problem and needs to close etc.. The error is further detailed as follows AppName: outlook.exe AppVer: 12.0.4518.1014 AppStamp:4542840f ModName: msvbvm60.dll ModVer: 6.0.96.90 ModStamp:41109750 fDebug: 0 Offset: 00100f99 Outlook will forward send and receive ok just wont start a new message Any suggestions? Leon Create a new mail profile after an upgrade. --=81 Milly Sta...

How update entity in post update?
I created a handler for Update post callout for Opportunity. I want update some fields of the opportunity on the PostUpdate. However, if I call the Update method of CRMOpportunity in the PostUpdate I will create a recursive post callout. Can somebody help me? Thank you for pay attention []'s Vin�cius Pitta Lima de Ara�jo You need to check the OrigObjectXML field to see what fields were updated and then act appropriately. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Wed, 4 Aug 2004 17:43:17 -0300, "Vin�cius ...

Any way to make the web query refresh to be done in the background?
currently when refreshing the data ... the mouse pointer will be bus and nothing i can do until it finish ... any way to set it so that i can do in the background without distrubing my interaction ? Thank if anyone can help .. Regards -- kitste ----------------------------------------------------------------------- kitster's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1495 View this thread: http://www.excelforum.com/showthread.php?threadid=26912 ...

Display Message While Running Macro
I have a macro that does quote a few things and takes for 5 to 1 seconds to run. Ive noticed that users of my sheet somewhat freak ou because the macro runs thru several pages and the users think that th computer has a problem. Is there a way i can have a message box o blank page with a message displayed that has no buttons (OK/YES) tha shows only while the macro is running to tell the user what th workbook is doing. Something simple not very good with VB Thank -- Db171 ----------------------------------------------------------------------- Db1712's Profile: http://www.excelforum.com/mem...

554 Message not allowed
The server clock was incorrect. I reset it. Some messages were sent in the future. I fixed this problem. I got the above error message on some emails - not all. I know some message went through with the future date on my end and real date on their end. Do I need to resend the email with corrected date to the ones I got the error message on? Yes you will need to resend those emails. They did not reach the other recipient. ------------------------------------------------------------------------ View this thread: http://www.outlookforums.com/showthread.php?t=46093 ht...

Cannot install update KB979906 for .NET Framework 1.1 SP1
Running : Windows XP media center edition SP3 Have tried installing KB979906 a few times and also downloaded update manually but cannot install this update. Receiving error 0x643.Is it safe to uninstall the .NET Framework 1.1 and re-install as possibly corrupt , without having to uninstall/re-install all other .NET frameworks 2 , 3 and 3.5 including the updates that go with them? .. Hello sherlockomes, you might want to look at the following kb article to see if this will help with the error 80070643. <http://windows.microsoft.com/en-US/windows-vista/Windows-Update-error...

Deleted messages delete themselves??
Hello, As I deleted an email, I watched the Deleted Folder move from (89) to (90), then Back to (89) again. Anybody know where these things are going? If I do a search I find them in the deleted folder, but I cant manually scroll through the list and find them. It appears from the settings that the AutoArchive is turned off. I dunno what Im doing! Heeelp? "Tim Wiitanen" <timw@vanlanen.com> wrote in message news:0f5501c36bf2$a504d1c0$a601280a@phx.gbl > Hello, > > As I deleted an email, I watched the Deleted Folder move > from (89) to (90), then Back to (89) a...

Print record once, update Yes/No field verifiying print
I would like to print a group of records, then have a Yes/No field [Printed] updated in my Jobs table with an update query showing the records were printed. Then next time the report runs, In my query criteria I will test for True values on the Yes/No field. Then only the records with the Yes/No field marked No will print. Any suggestions? Thanks Tommyboy,there's more to this question than meets the eye. For an explanation of what's involved, see: Has the record been printed? at: http://allenbrowne.com/ser-72.html The article includes a free sample database that dem...

latest update too MSCFV2
Hi, I have MSCFV2 version 6.5.7825.0. Could someone inform me if this is the latest download? Looks like you have 6.5.7825.0 from 05/21/2006, but there is a newer version - 6.5.7831.0 from 06/01/2006. C. Smith Enso Technologies, Incorporated http://www.ensotech.com On Tue, 13 Jun 2006 04:25:02 -0700, Paul <Paul@discussions.microsoft.com> wrote: >Hi, > >I have MSCFV2 version 6.5.7825.0. Could someone inform me if this is the >latest download? Christopher Smith csmith@ensotech.com Enso Technologies, Incorporated http://www.ensotech.com Also - meant to post this in t...

Dynamic Menu update
Hi All, I need to update a menu item dynamically, setting its SetCheck property to either true or false, based on a user operation. I am trying to do this from a custom function. Usually, the pCmdUI pointer is used. But how do I do it from another function? Thanks Your "other function" should change some setting. In your ON_UPDATE_COMMAND_UI handler, you should check that setting and call SetCheck as needed. -------------- Ajay Kalra ajaykalra@yahoo.com In addition to Ajay's response, this page may help you: http://msdn2.microsoft.com/en-us/library/6kc4d8f...

online updates for money2003(not updating)
Money gets its updates from spcomstock.com and the server has moved to a new site. The default site that money provides has to be changed. At this time I don't know how to do this. If I find out how to do this I will Post it. ...

Warning in KB822444 ?
Warning in KB822444: "If you change the administrative group site folder GUID, do not restore previous backups of any public folder store in your Exchange organization. If you do so, you may cause duplicate site folders to be created, cause existing site folders to be destroyed, cause the site folder server's public database to stop replicating permanently, or prevent other public stores in the site from accepting replicas of site folders. To correct such problems, you may have to remove and rebuild public folder stores on some or all servers in your Exchange organization."...

I need a rule to MOVE messages instead of COPYING them; can anybody help?
Hi all, I get a lot of mail, and keep them organized by name of the contactperson. For example: mail I either send to or receive from Pete, has to be moved to the Outlook-folder "Pete", after the mail has been read by me (in case of a receipt from a message from Pete) or after it has been sent (in case of mail I sent to Pete). Outlook rules do not allow for this; you can only copy messages (which means you have duplicate messages in Outlook). Maybe a macro could do the trick, but you need to write macro's and I am not a technical guy:-(. Would anybody know a solution, or would a...

Payroll Update
HI all, We are running GP 7.5. I installed SP7 and the July 2005 tax update for CDN payroll. Now out payroll administrator gets an error message: 'The modified version of P_Payroll registry is missing'. How do I fix this problem Thanks -- Henry ...