No Warning on Duplicate Value (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:03
Joined
May 21, 2018
Messages
8,463
I have a table with the item_name field indexed to be unique. If I try to enter a duplicate in the table it works and gives an error message when trying to add a duplicate. At the form I get no error message; however, it does not save anything as designed. I purposely added docmd setwarnings = true even though I never set it to false. That is the only thing I think could cause this. It acts as if warnings are set to false, but there is nothing doing that. Any ideas of what could cause this behavior? Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:03
Joined
Oct 29, 2018
Messages
21,358
Just a guess, but is there anything in the Form's On Error event?
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:03
Joined
May 21, 2018
Messages
8,463
No, nothing there. What is even stranger is if I X out it works, if I use the close button which is simply Docmd.close... it provides no message.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:03
Joined
Oct 29, 2018
Messages
21,358
Maybe corruption then? Just thinking out loud...
 

isladogs

MVP / VIP
Local time
Today, 01:03
Joined
Jan 14, 2017
Messages
18,186
A wild guess...do you have any empty form events i.e. with no code
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:03
Joined
May 21, 2018
Messages
8,463
No form events with no code, and I have decompiled the db. Thanks for the guesses. It is not a big problem, because it actually not allowing a duplicate, but cannot figure out how. I plan to check the before update anyways and give a custom message.
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 21:03
Joined
Jan 23, 2006
Messages
15,364
Sounds like possible corruption??
Is it a data base you could post ?

Here is some info (via Google) that may be useful.
 

Users who are viewing this thread

Top Bottom