Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate Key Violation is not displayed

Status
Not open for further replies.
Feb 12, 2001
52
0
0
GB
I have an Inventory Control database. One of the tables (Products) has a field (PartNo) as primary key and is indexed "Yes".
When I attempt to add a part number that already exists, I was hoping that I would get a warning message to the effect that I was trying to enter a duplicate. Nothing happens - a user would think it has been added.
Have I forgotten to do something in the design?
 
Hi

At which point does 'nothing happen' are you saying it allows you to actually save a duplicate key?

Do you have any on error code which is perhaps bypassing an error message



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
What I mean by "nothing happens" - To add a new product I have a form. i enter the duplicate part number and different details (e.g description etc). when i close the form, there is no indication of anything untoward i.e just the same as when I add a genuine new part number.
when i look at the Products table, the original part number and description is there, but nothing for the duplicate. My concern is that the user would think he has added a part number - allbeit a duplicate but unless he looked at the table or full products listing he wouldnt realise that the duplicate he attempted had disappeared into the ether.
Hope this is clear!
 
HarrisHarris,

Did you develop this DB or inherit it? I agree with KenReay, it sounds as if somewhere in your code the Access warnings have been set to False (often done to not show a message warning about an action that's about to be done or to insert your own error message) and was not reset to True afterwards.

The Missinglinq


"It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
The DB was desined by myself (amateur). At one time I did switch off messages - Tools - Options - Edit/Find - Confirm box all three were switched off but I have since switched them on again and still no warning about attempting to add a duplicate part number.
 
Stop Press

I have just tried entering the duplicate part number directly into the table - the duplicate warning message displayed. Obviously something wrong in my form.
 
Thanks for your help. Found the problem. Button on my form was close only and not save. added the save code and now the duplicate msg comes up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top