fredg said:
Then I would guess that you have some code running that has:
DoCmd.SetWarnings False
somewhere and you have neglected (or the code errors out before this
point) to set
DoCmd.SetWarnings True
Search your code for SetWarnings False and make sure for each False
there is a corresponding SetWarnings True value that the code will
always read, even if there is an error.
I respectfully disagree. Using DAO's currentdb.execute or ADO's
CurrentProject.Connection.Execute means never having to worry about
Setwarnings. And you get to see error messages that the action query
may produce.
I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql. For ADO use
CurrentProject.Connection.Execute strCommand, lngRecordsAffected,
adCmdText
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
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/