Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 4th, 2004, 09:12 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 137
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update queries


I have created several updates queries for my database which at present when run Access issues a warning message. Is possible to disable these messages and create my own? And if so how?

Gaz
__________________
Gaz
 
Old March 4th, 2004, 09:23 AM
Authorized User
 
Join Date: Dec 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use the DoCmd operator if you use code. From memory the syntax is "DoCmd Setwarnings.false" or something very similar. However you should remember at the end of your code to use "DoCmd Setwarnings.true"

 
Old March 4th, 2004, 10:03 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Before execution it would be:
Code:
DoCmd.SetWarnings False
and after the query use:
Code:
DoCmd.SetWarnings True
Beth M
 
Old March 4th, 2004, 11:57 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 137
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Beth your suggestion work.

Many thanks to everyone else also

Gaz
 
Old March 4th, 2004, 06:18 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another option would be to use Execute instead of RunSQL

So you'd have something along the lines of:
Code:
CurrentDb.Execute("DELETE * FROM Table1 WHERE Field1='Something'")
rather than:
Code:
DoCmd.SetWarnings False
DoCmd.RunSQL ("DELETE * FROM Table1 WHERE Field1='Something'")
DoCmd.SetWarnings True
Diff'rent Strokes. It takes. Diff'rent Strokes. It takes. Diff'rent Strokes to move the world, yes it does

I am a loud man with a very large hat. This means I am in charge





Similar Threads
Thread Thread Starter Forum Replies Last Post
IIF Formulas used in Update queries kypros79 Access 5 April 12th, 2018 09:06 PM
update multiple columns in an update statement debbiecoates SQL Server 2000 1 August 17th, 2008 04:01 AM
Combining Queries or results from 2 queries Ford SQL Server 2000 24 November 7th, 2005 08:54 PM
update/insert work in queries but not on form jonicholson Access VBA 3 January 18th, 2005 06:05 PM
Queries xzvi0r Access 5 September 8th, 2003 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.