Suppress all warnings except key violation warnings

sometimes24

Registered User.
Local time
Yesterday, 16:36
Joined
Feb 26, 2014
Messages
10
Hello everyone,

So, I'm new to access and I've gone a long way and I have one more step before I'm done. I want to suppress the warnings that says things like about to run an append query, about to append two rows, about to delete...

BUT I want the key violation warning to show. I'm using a macro and at the beginning I set warnings to off. I know that my warning number is 10510. It occurs while an append query is running so I don't know how to edit that

Any ideas?
 
what do you mean by the key violation warning? Are you referring to the Primary Key (PK) of a table? If so you can not disable the warnings for a specific error.
However you can check for duplicate PKs prior to running your query. Use the Dcount() function to count the table for occurrences of the PK and if > 0 then the new one is not allowed and you can display a custom message.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom