473,657 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setwarnings action default assumptions

2 New Member
Database: MS Access

Subject: SetWarnings macro action

I am running macos to run several action queries that replace existing tables with new data based on parameter dates. There are several tables to update and to avoid the annyance of promts system messages have added an argument at the beginning of the macro to switch the warning off:

Action: SetWarnings
Argument: No

everything seemed fine but i have since realised that the action queries were not running - the reason being: "Carrying out this action with the Warnings On argument set to No has the same effect as pressing ENTER whenever a warning or message box is displayed. Typically, an OK or Yes button is chosen in response to the warning or message"

the typical message i would get on running the query would be:
The existing table "table" will be deleted before you run the query. Do you want to run the query anyway?
the default answer (the result of pressing enter) is "no"
I want it to say yes - delete the table and replace the date
hence it would appear that the setwarning action will not work for me

Has anyone else encountered the same issue - and can anyone suggest a neat solution?

Many Thanks

Paul
Apr 4 '07 #1
2 2181
Rabbit
12,516 Recognized Expert Moderator MVP
Delete the table with code before running the make table query.
Apr 4 '07 #2
Denburt
1,356 Recognized Expert Top Contributor
If you put this in a function in VBA code you can use your macro to call this function and it will work. I don't typically use macros I would just call the function however I am not sure how you have this set up or where you are calling the macro from.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2.  
Make sure you change it back to true when you are done or you could delete things, save things etc. and never realize it since you will get no prompt whatsoever.
Apr 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

21
5998
by: Colleyville Alan | last post by:
I am now using the Execute command to run SQL for action queries. When I had them as saved queries, I would use DoCmd.SetWarnings False to allow the queries to overwrite existing tables. when I use this code: CurrentDb().Execute strMySql', dbFailOnError I still get warnings that the table already exists. Is there another command that I am supposed to use?
5
683
by: DC Fan | last post by:
Hi all... Been a while since had a question here, but I can not find a single thing about this in the group or even on the whole web! My Access XP application is running some stored queries and some SQL statements and I am using DoCmd.Setwarnings False to turn off the default "Are you sure" warnings in Access. When it hit's certain setwarning commands, it gives the error dialog in the subject of this post. An example of my code follows....
13
12161
by: Robert McEuen | last post by:
This is probably really simple, but I can't find a thread that addresses it. Is there any way to evaluate in code whether the current state of the SetWarnings command is set to True or False? I have a Public Sub that I want to use from several areas of my application, and I want to turn off warnings for it, but I don't want to set warnings back to True if the sub was invoked from another sub or function where warnings had already been...
10
7204
by: MLH | last post by:
I thought I could run docmd.SetWarnings in the immediate window with no argument and A97 would return True or False, depending on the current setting. I was wrong. Anybody know how to make the determination in the immediate window?
12
5881
by: Pradeep Varma | last post by:
Hello, I am suppressing the warnings in Ms Access database by using the DoCmd.SetWarnings=False statement. However I want to get a list of all the Warnings that were generated between a: DoCmd.SetWarnings False and DoCmd.SetWarnings True Please Suggest.
6
2273
by: MLH | last post by:
In my Tues, Mar 21 2006 original post on this topic, Allen Browne made a very good case for use of the Execute method instead of firing an action query with RunSQL or OpenQuery. Ex- ploring the topic just a bit further... I'm wondering if VB receives any event notice indicating that a confirmation dialog just opened? That is, can I tell if a confirmation dialog WAS encountered and then act on it?
16
3488
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for renaming the duplicate records? My thinking was to take the results of the duplicate query, and somehow have it number each line where there is a duplicate (tried a groups query, but "count" won't work), then do an update query to change the duplicate to...
5
1927
by: MLH | last post by:
Access 97 does not provide a means of reading the most recent setting for SetWarnings Method. For example, if you had CBF that called a procedure in a global module and the following statement was executed: DoCmd.SetWarnings False Then you would not be able to take peek at the setting when processing returned to the calling
1
3072
by: natural | last post by:
Good Afternoon I have an option grou[ and on the after update i would like to provide the user with a msgbox, and then action placed my docmd.setwarnings false everywhere, but i still get my "record has been deleted". Is i possilbe to please assist in where i am going wrong Private Sub RecOffLet_AfterUpdate() On Error GoTo Err_Handler
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7351
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
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
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.