How to suppress confirmation messages when inserting or del recordsin backend tables?

jaishu

Registered User.
Local time
Today, 11:49
Joined
Feb 13, 2007
Messages
13
When i try to insert data into a backend Oracle table (with ODBC) using a form, (i use docmd.runsql "insert....") Access gives me a message like"You are trying to append 1 row to the table are you sure you want to append?"

i want to suppress this message as i have to insert into 2 tables and delete from 3 tables when the user enters some data in the form, so it asks the user five times (say 2 times for insert and 3 times for delete..) when it inserts or deletes each table. the user doesnt want this to click every time when they do that...
how do i suppress these messages, is it Access-specific or oracle specific?
I am not able to do this..!
is this any kind of exception that i have to put in??

Thanks for all ur help!!
 
try

Docmd.setwarning False


but make sure to set them back to True when you are finished.
 
And I can't stress enough - Put an Error Handler on any code that uses DoCmd.SetWarnings(False) and make DoCmd.SetWarnings(True) as the very first thing that runs in your error handler. Otherwise, if your code that sets it to false errors out and doesn't make it to set it back to True, you will end up with no errors anywhere at any time. I ran into that myself so I ALWAYS now include that code in my error handlers when I set the warnings to false in the sub or function.
 
Bob, you may want to correct me here but I use CurrentDb.Execute YourSQLString, dbFailOnError rather than DoCmd.RunSql YourSQLString for any action query and avoid messing with the Warnings alltogether.
 
I would say that's the better way, but I haven't used that one as I was just used to the other. You are correct about that. But there are also other times where someone might want to set the warnings and so it would be imperative to have them reenabled in the error handler.
 
No question about making sure the Warnings get turned back on. I just try to turn them off as seldom as possible.
 

Users who are viewing this thread

Back
Top Bottom