SQL UPDATE command warning message and error

R

rc51wv

I have an SQL UPDATE statement that runs so the user can update certain
information in the table. The problem is, when I click on the update button
Access throws up a warning message saying that you are about to change x
amount of rows and once it's done it can't be undone, do you wish to continue.

When you click yes it goes about it's business and updates the rows in the
table that you are directing it to. When you click no it gives the error that
RunSQL command did not execute and gives the user the option to debug,
allowing them possible access into the code.

How do you prevent this message from displaying?
 
O

Ofer

If you want to remove the messages for all queries, without using the set
warnings, then in the menu bar select
Tools > Options > Edit/Search (Tab) > Confirm Action Queries (remove the
selection)

But you have to know that it will never prompt with the message event when
you are using the queries dirrectly
==================================
if you don't want to use this method, then after you run the update query
you need to set the warnings back to true

Docmd.SetWarnings False
Docmd.OpenQuery "QueryName"
Docmd.SetWarnings True
 
G

George Nicholson

In addition to your other response regarding the use of "Set Warnings":

AFAIK, if you password protect your VBA project, "Debug" becomes a disabled
option on all Message boxes where it appears (once you re-open the app). You
can enable it (for the current session only) if you want to by opening the
VBE and supplying the password that allows you to view the project code.

In the VBE: Tools> (App Name) Properties....>Protection

HTH,
 

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