Annoying Warning Messages

J

Joe Delphi

Hi,

I wrote an MS Access/VBA program that deletes records and inserts
records into tables when the user presses a form button. It works fine on
my development computer.

I took it to my customer's computer, which is running the same
version of MS Access, and when he pushed the button, a warning message would
display saying "You are about to delete 1 record, do you want to do this?"
since the program looped the annoying message appeared multiple times.
Customer not pleased.

I know that there must be an option setting on his computer that I
can set or un-set to turn these warning messages off. Can someone tell me
how to do this?


Thanks,
JD
 
T

tina

suggest you write code into your procedure(s) to turn Warnings off and on
before and after the deletes and appends, so the messages will be suppressed
regardless of what PC the application runs on, as

DoCmd.SetWarnings False
<delete and/or append record(s) code>
DoCmd.SetWarnings True

see the SetWarnings Action topic in VBA Help for more information.

hth
 
R

RoyVidar

Joe Delphi said:
Hi,

I wrote an MS Access/VBA program that deletes records and
inserts records into tables when the user presses a form button. It
works fine on my development computer.

I took it to my customer's computer, which is running the
same version of MS Access, and when he pushed the button, a warning
message would display saying "You are about to delete 1 record, do
you want to do this?" since the program looped the annoying message
appeared multiple times. Customer not pleased.

I know that there must be an option setting on his computer
that I can set or un-set to turn these warning messages off. Can
someone tell me how to do this?


Thanks,
JD

You have probably altered some of the settings in Tools | Options -
Edit/Find tab, in perticular under the "Confirm" group, the Action
queries bit.

I think these might be global Access settings, which might alter the
behaviour of Access on all databases, so I don't think I'd recommend
altering those, but rather use other methods of avoiding the
messages.

If you're doing lot of queries through the docmd.runsql method, you
could consider executing them through for instance the .execute
method of the currentdb object in stead

CurrentDB.Execute "DELETE FROM mytable", dbFailOnError

or turn the warnings on and off per each use

DoCmd.SetWarnings False
DoCmd.RunSql "DELETE FROM mytable"
DoCmd.SetWarnings True

But then you can also turn this option on and off through the
SetOption method of the Application object, see
http://support.microsoft.com/kb/229802/
for more info
 

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