How do I get rid of the warning message when deleting a record using a query?

105ben

Registered User.
Local time
Today, 02:06
Joined
Feb 2, 2013
Messages
42
Hello,

How do I get rid of the warning messages when using a delete query?

I then want to add a simple yes/no box, that will stop the query is no is pressed.

Any help appreciated!
 
You can stop the warning by turning warnings off before you run the query and then back on after the run query statement. It is IMPERATIVE that you remember to turn the warnings back on. If you don't, Access will SILENTLY discard changes you made to objects if you forget to save before closing. Spend an hour writing code in a form's module and loose it all because you just closed the form and didn't save is all it will take for you to never forget again. I am not that easily trained so my solution was two macros (the only two macros in my applications). The first sets the hourglass on and the warnings off and the second sets the hourglass off and the warnings on. That way if I'm working and stop the code for debugging, I have a visual reminder that the warnings are off. I can then manually run the macro to turn them back on and the hourglass off.

As to popping up your own message, you will need to do it before running the code. You can't intercept the warning message and substitute it with your own.
 

Users who are viewing this thread

Back
Top Bottom