"Matt" <md*******@yahoo.comwrote:
>Is there a way to get the information in this message through VBA
code?
I run the query from code, but it does not throw an error, so my
error
trapping code will not catch it. I would like to somehow know when
this happens.
Are you using docmd.runsql? If so use currentdb.execute instead.
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