How to avoid system massage after append or delete action.

T

Tony Toews

I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql. For ADO use
CurrentProject.Connection.Execute strCommand, lngRecordsAffected,
adCmdText

If you're going to use docmd.setwarnings make very sure you put the
True statement in any error handling code as well. Otherwise wield
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
--
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
 
6

'69 Camaro

You may also want to remove the confirmation system message on action
queries to avoid system messages like "You are about to run a delete query
that will modify data in your table. Are you sure you want to run this type
of action query?" by opening the "Tools --> Options" menu and selecting the
"Edit/Find" tab. Make sure "Action Queries" is not checked in the "Confirm"
section in the dialog window.

HTH.
Gunny

Coming soon:
For your Microsoft Access, database development and maintenance needs, see:
http://www.softomagixly.com
 
T

Tony Toews

'69 Camaro said:
You may also want to remove the confirmation system message on action
queries to avoid system messages like "You are about to run a delete query
that will modify data in your table. Are you sure you want to run this type
of action query?" by opening the "Tools --> Options" menu and selecting the
"Edit/Find" tab. Make sure "Action Queries" is not checked in the "Confirm"
section in the dialog window.

That's the quick and dirty solution. There are times when I'm doing
some data cleanup when I want to know exactly how many records it's
going to update.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top