Suppressing the primary key voilation message

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
 
A

Allen Browne

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?
 
G

Guest

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
 
A

Allen Browne

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.
 

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