Turning off message "Can't Add all the records in the Update or Append Query"

K

Ken Higgins

I get this message - and I know why I get it.

But I am trying to turn it off and handle the error myself
and avoid this pesky prompt.

Anyone know how to suppress this message?
On Error does not seem to work although it returns a 2501
error code.

Ken Higgins
 
T

Tom Ellison

Dear Ken:

The way I'd suggest handling this is to remove the attempts to add
rows illegally. There are several causes for this, from which you
have apparently identified those that cause the problem. These
include:

- attempting to add a row which duplicates a unique key in the
destination table

- attempting to add two or more rows that share a unique key in the
destination table

- attempting to add a row that would violate a foreign key
relationship

- attempting to add a row containing a null value in a required column

These, and any other violations, should be removed from the set of
rows being added. Don't do this by deleting them from the source
table, but by filtering them from the set being appended. The same
filtering can be used to create a report of the rows not added, or to
handle them in some other way, just reversing the logic.

I get this message - and I know why I get it.

But I am trying to turn it off and handle the error myself
and avoid this pesky prompt.

Anyone know how to suppress this message?
On Error does not seem to work although it returns a 2501
error code.

Ken Higgins

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

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