Suppressing the primary key voilation message

  • Thread starter Thread starter Tony Nichols
  • Start date Start date
T

Tony Nichols

Can anyone tell me if you can suppress the intrinsic
primary key voilation dialog box?

I have written a 3022 error trap in the error event a
form to display my own error message to the user. After
the error occurs I use the undo method to clear the
fouling condition but the intrinsic dialog box still is
presented to the user.

I am using Access 97.

Any assistance would be appreciated. If you need
details about the code I can post it, I think my request
is clear.

Thanks in advance,
Tony Nichols
 
Hi Tony

You should be able to suppress the message in the form's Error event if you
set the Response argument to acDataErrContinue instead of acDataErrDisplay.

Not sure about how the timing of the Undo affects this: are you undoing the
control or the form?
 
Hello Allen,

Thanks for the reply. I am undoing the form as I do not
want to update the record in the situation.

I will implement the variable you detailed. I am
assuming I can just use a statement of:

Response = acDataErrContinue
in the Error event of the form?

Where can I find out the different values for the
arguments in the event and detemine what the effect of
the value is? I quickly looked in the help file and
found nothing.

Again thanks for the response.

Tony
 
Yes. Just use:
Response = acDataErrContinue

Although Help has been woeful in recent versions of Access, the A2003 help
reference under the Error event does list the 2 possible constants for this
argument.
 
Back
Top