28-Jul-2006, 08:00 AM
| || |
| || || || || |
| || |
Re: A Debug Challenge...
>DoCmd.RunSQL ("update tblsitevisits set visitdesc = '" & Visit2 & "' where
>servicecall = txtservicecall and sitevisitnumber = txtlastsitevisit;")
>The result is that the Update does not take.
>I have stepped through, with warnings...run debug...and substituted values.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9232-a-debug-challenge.html
>No warnings; empty debug window; and any configuration of substituted values
I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql. For ADO use
CurrentProject.Connection.Execute strCommand, lngRecordsAffected,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9232
If you're going to use docmd.setwarnings make very sure you put the
True statement in any error handling code as well. Otherwise weird
things may happen later on especially while you are working on the
app. For example you will no longer get the "Do you wish to save your
changes" message if you close an object. This may mean that unwanted
changes, deletions or additions will be saved to your MDB.
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 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