Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.SetWarnings False in Access 2002/3

Status
Not open for further replies.

paulwood

IS-IT--Management
Apr 10, 2001
896
0
0
GB
I have had a script running perfectly in Access 2000, but now the client wants to start running 2003. When it gets to

DoCmd.SetWarnings False
mySQL = "DELETE * FROM table_name"
DoCmd.RunSQL mySQL
stDocName = "query_name"
DoCmd.OpenQuery stDocName
DoCmd.SetWarnings True

it works as 2000 until it attempts to append records in the DoCmd.OpenQuery stDocName bit when it informs me each time that it will append one record. This happens for every append, which is a nuisance when it is around 10 records, but over 30 or so it is unworkable. All the other warnings are ignored, except just this one. What am I doing wrong, I have tried all the switches on the DoCmd.OpenQuery but they don't make any difference to the error reporting.
 
Hi,

Just a guess, but you can also switch off messages in the general options of Access (option menu).

EasyIT
 
I am considering that, but it's a program-wide option rather than mdb-wide isn't it? I'm not keen to turn off all Action Queries for all database as they are heavy Access users and they may need it turned on in some db's.
 
Have you tried re-writing your code:

DoCmd.SetWarnings False

mySQL = "DELETE * FROM table_name"
DoCmd.RunSQL mySQL
DoCmd.OpenQuery "query_name", acNormal, acEdit

DoCmd.SetWarnings True
 
OK, just tried that, afraid it didn't make any difference. On another tack, is there any way of turning the Action Query option on and off programatically?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top