[AccessD] RE: DoCmd.RunSQL or CurrentDb.Execute (Solved)

David Fenton dfe at nudgeeinternational.com
Wed Jan 7 22:33:34 CST 2004


Hi Folks,
Thank you to Stuart and Steve for your help on this one. It kind of
confirmed what I already knew and I think I like the CurrentDb.Execute.
I have been switching off errors, using the DoCmd and switching errors
back on. I leave errors on for testing purposes to eliminate as many SQL
errors as I can, but if it is error free then I think the CurrentDb
method will suit me better.

Thanks again for your advice.

Cheers 
David Fenton
Brisbane
Australia
.............................................
Message: 14
Date: Tue, 6 Jan 2004 17:42:40 -0500
From: "Developer" <Developer at UltraDNT.com>
Subject: RE: [AccessD] DoCmd.RunSQL or CurrentDb.Execute?
To: "'Access Developers discussion and problem solving'"
	<accessd at databaseadvisors.com>
Message-ID: <004601c3d4a6$643bdbd0$7001a8c0 at COA3>
Content-Type: text/plain;	charset="us-ascii"

Currentdb.execute will bypass the warnings if they are on,
Docmd will still have the warnings.
Currentdb has been faster for me, but I havent benchmarked anything
specific. 

Hth
Steve



Message: 15
Date: Wed, 07 Jan 2004 08:40:19 +1000
From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
Subject: Re: [AccessD] DoCmd.RunSQL or CurrentDb.Execute?
To: Access Developers discussion and problem solving
	<accessd at databaseadvisors.com>
Message-ID: <3FFBC5F3.22232.16B2F9 at localhost>
Content-Type: text/plain; charset=US-ASCII

On 7 Jan 2004 at 8:22, David Fenton wrote:


With DoCmd.RunSQL, you get the standard messagebox 'You are about 
to...." 

If you want the update to happen without any user action, use  
CurrentDB.Execute. If you want the warning and  the user to have the 
opportunity to cancel the action, user DoCmd.RunSQL 

Note that  
"DoCmd.SetWarnings False
 DoCmd.RunSQL strSQL
 DoCmdSetWarnings True"

suppresses the update notice, but also has the effect of suppressing 
any error messages generated by a problem in strSQL.

-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.

******************************


More information about the AccessD mailing list