Disable Error Message when using DoCmd.RunSql

  • Thread starter Thread starter Geoff
  • Start date Start date
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.
 
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
 
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
 
Back
Top