Disable Error Message when using DoCmd.RunSql

G

Geoff

How can I supress the message saying that my app can't append all records
due to Key Violations? I only want to suppress the message and allow the
query to run anyway.
 
G

Guest

If you running the query through code then add the syntax
docmd.setwarnings False ' before excute the query
run query here
docmd.setwarnings True ' dont forget to set it back to true
 
T

Tim Ferguson

How can I supress the message saying that my app can't append all records
due to Key Violations? I only want to suppress the message and allow the
query to run anyway.

Clean the incoming data first. You could join the old table to the new
table on the primary key and find matching records. You then have to decide
what you want to do with matches: overwrite the old one, drop the new one,
ask the user, etc etc.

Hope that helps


Tim F
 

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