Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Catch duplicate error when inserting into table and display msg

Geek News

Catch duplicate error when inserting into table and display msg
Akilah 12/16/2008 10:55:01 PM
If two users are insert the same, exact data into the same table and the
warnings are off, is there a way to capture and display the duplicate error?

Thanks
Re: Catch duplicate error when inserting into table and display msg
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 12/16/2008 11:47:28 PM
How are you inserting?

Perhaps you are using an append query statement (since you mention turning
warnings off.) If so, see:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html

If you are using a bound form, your options are:
a) Use the Error event of the form; or
b) Perform a DLookup() in Form_BeforeUpdate.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Akilah" <Akilah[ at ]discussions.microsoft.com> wrote in message
news:2C170FAD-B284-4F69-9FE7-503CF4A74439[ at ]microsoft.com...
[Quoted Text]
> If two users are insert the same, exact data into the same table and the
> warnings are off, is there a way to capture and display the duplicate
> error?
>
> Thanks

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net