By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,654 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,654 IT Pros & Developers. It's quick & easy.

turn warnings off in Access

P: n/a
Anyone know how to do the equivalent in Access VBA to:

Application.DisplayAlerts = false (as you do in VBA Excel)

For some reason after I do compact on my db Access starts displaying
all the warning messages when you delete rows etc in the code.

Colm.

May 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MLH
DoCmd.Setwarnings False is what I use.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 7 May 2007 03:55:27 -0700, colmkav <co******@yahoo.co.ukwrote:
>Anyone know how to do the equivalent in Access VBA to:

Application.DisplayAlerts = false (as you do in VBA Excel)

For some reason after I do compact on my db Access starts displaying
all the warning messages when you delete rows etc in the code.

Colm.
May 7 '07 #2

P: n/a
thx, yes I just sussed it out anyway.

On 7 May, 13:00, MLH <C...@NorthState.netwrote:
DoCmd.Setwarnings False is what I use.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On 7 May 2007 03:55:27 -0700, colmkav <colmj...@yahoo.co.ukwrote:
Anyone know how to do the equivalent in Access VBA to:
Application.DisplayAlerts = false (as you do in VBA Excel)
For some reason after I do compact on my db Access starts displaying
all the warning messages when you delete rows etc in the code.
Colm.- Hide quoted text -

- Show quoted text -

May 7 '07 #3

P: n/a
MLH <CR**@NorthState.netwrote:
>DoCmd.Setwarnings False is what I use.
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 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
--
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
May 7 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.