473,396 Members | 1,921 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,396 software developers and data experts.

SetWarnings False does not work

Hello --

After I run a macro which refreshes test data, running the app results in
warnings like
"You are about to delete .. records ..."

The macro contains pairs of
DELETE FROM table WHERE column Like "_*"
and
INSERT INTO table SELECT * FROM TESTdata

Use Transaction is set to "No"

Nowhere in my code do I have
DoCmd.SetWarnings True

At the beginning of the app I have
DoCmd.SetWarnings False

Does anyone know how Warnings get turned on?
Thanks for any help.

Larry Mehl
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.562 / Virus Database: 354 - Release Date: 1/16/2004
Nov 12 '05 #1
3 5961
Hi:

I don't know if its conventional to copy other peoples reply to questions, but the
following reply was sent to me regarding almost exactly the same issue:
I have W98 and Access 2000, and am running a fairly complex application with all sorts of
delete and append queries. These queries run in background on my system, and make no fuss
when they execute. I am now moving the application to another system which has Windows XP
(Home) and Access 2003 (or possibly 2002). When it runs on the new system all sorts of
irritating warnings pop up (delete queries for example) and interrupt the whole process.
How do I switch these OFF? I cant find the settings to do this.
These are somewhere in the Tools >> Options possibly Edit/Find at least in A97. But
this is not your best place to make this change. This is the quick and dirty fix.
Standard blurb follows:

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


"L Mehl" <me*********@cyvest.com> wrote:
Hello --

After I run a macro which refreshes test data, running the app results in
warnings like
"You are about to delete .. records ..."

The macro contains pairs of
DELETE FROM table WHERE column Like "_*"
and
INSERT INTO table SELECT * FROM TESTdata

Use Transaction is set to "No"

Nowhere in my code do I have
DoCmd.SetWarnings True

At the beginning of the app I have
DoCmd.SetWarnings False

Does anyone know how Warnings get turned on?
Thanks for any help.

Larry Mehl
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.562 / Virus Database: 354 - Release Date: 1/16/2004


Nov 12 '05 #2
Hi John --

Thanks. I don't think Tony will mind. You attributed the answer to him.

I have started using Currentdb.Execute strSQL,dbfailonerror command instead
of >docmd.runsql.

I don't want ACCESS to display "Do you wish to save your changes" messages
and prefer to use validation of fields before I allow a user out of a
process.

Larry
"John Baker" <Ba******@Verizon.net> wrote in message
news:nr********************************@4ax.com...
Hi:

I don't know if its conventional to copy other peoples reply to questions, but the following reply was sent to me regarding almost exactly the same issue:
I have W98 and Access 2000, and am running a fairly complex application with all sorts ofdelete and append queries. These queries run in background on my system, and make no fusswhen they execute. I am now moving the application to another system which has Windows XP(Home) and Access 2003 (or possibly 2002). When it runs on the new system all sorts ofirritating warnings pop up (delete queries for example) and interrupt the whole process.How do I switch these OFF? I cant find the settings to do this.


These are somewhere in the Tools >> Options possibly Edit/Find at least in A97. Butthis is not your best place to make this change. This is the quick and dirty fix.Standard blurb follows:

I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror command instead ofdocmd.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 inany error handling code as well. Otherwise wierd things may happen later onespecially 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 meanthat unwanted changes, deletions or additions will be saved to your MDB.

Also performance can be significantly different between the two methods. One postingstated currentdb.execute took two seconds while docmd.runsql took eight seconds. Asalways 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


"L Mehl" <me*********@cyvest.com> wrote:
Hello --

After I run a macro which refreshes test data, running the app results in
warnings like
"You are about to delete .. records ..."

The macro contains pairs of
DELETE FROM table WHERE column Like "_*"
and
INSERT INTO table SELECT * FROM TESTdata

Use Transaction is set to "No"

Nowhere in my code do I have
DoCmd.SetWarnings True

At the beginning of the app I have
DoCmd.SetWarnings False

Does anyone know how Warnings get turned on?
Thanks for any help.

Larry Mehl
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.562 / Virus Database: 354 - Release Date: 1/16/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.562 / Virus Database: 354 - Release Date: 1/16/2004
Nov 12 '05 #3
"L Mehl" <me*********@cyvest.com> wrote:
Thanks. I don't think Tony will mind. You attributed the answer to him.


Not at all.

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

5
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...
13
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...
10
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...
12
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: ...
6
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...
16
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...
5
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...
1
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...
6
by: RZ15 | last post by:
Hi, I frequently have code in my forms that will turn warnings off, run make table queries, then turn warnings back on using the following code: DoCmd.SetWarnings WarningsOff DoCmd.OpenQuery...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.