Go Back   Access World Forums > Microsoft Access Discussion > Tables

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-10-2019, 05:24 AM   #1
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
duplicate index

client on entry into form that is linked to main form not able to enter data
Keep getting the duplicate index error.
The field is an auto generated ID
Compacted and repaired to no avail.
This is a split db
I have looked in the tables for anything that might show the dup entry, but, find nothing...it never accepted the clients entry on 2 different occasions.
Suggestions?

jedder18 is offline   Reply With Quote
Old 10-10-2019, 05:37 AM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,334
Thanks: 40
Thanked 3,670 Times in 3,538 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: duplicate index

by autogenerated, do you mean an autonumber?

And have you checked the table design for fields set to 'indexed, no duplicates'
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 10-10-2019, 05:47 AM   #3
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,239
Thanks: 94
Thanked 2,026 Times in 1,973 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: duplicate index

More info please.
Do you get an error number and description?
Are users sharing the same front end or does each user have his/her own copy on their own PC?
You could post a copy of the database in zip format --

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Old 10-10-2019, 06:21 AM   #4
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Re: duplicate index

yes to the field being autogenerated.
Each client has front end copy on there pc's
I still need to compact the back end but now they're in it.
will try that later today.

I attached in jpg the error message
Attached Images
File Type: jpg duperror.JPG (28.3 KB, 16 views)
jedder18 is offline   Reply With Quote
Old 10-10-2019, 06:33 AM   #5
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: duplicate index

in multi-user environment, the autoGenerated key should be Provisional.
you must then Check the generated key against the table, to ensure that nobody has saved with same Key.
you can do this on BeforeUpdate event of the Form.
if you found out that there is alreay a key on the table generated New one and inform the user about the changes (in msgbox), then save the new key.
Code:
private sub form_beforeUpdate(cancel as integer)
dim vKey as variant
If dcount("1", "yourTable", "autogenKeyField='" & Me.autogenKey & "'") > 0 Then
    'the key on form is already in table (user is slow on working on form).
    'generate New one and present it to user
    vNewKey = yourKeyGenerator()
    while dcount("1", "yourTable", "autogenKeyField='" & vNewKey & "'") > 0 
             vNewKey = yourKeyGenerator()
    wend
    Msgbox Me.autogenKey & " already exists, will use " & vNewKey & " instead.", _
          vbInformation + vbOkOnly
    me.autogenKey = vNewKey
end if
end sub
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 10-10-2019, 06:34 AM   #6
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,926
Thanks: 57
Thanked 1,296 Times in 1,277 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: duplicate index

Quote:
Originally Posted by jedder18 View Post
yes to the field being autogenerated.
Each client has front end copy on there pc's
I still need to compact the back end but now they're in it.
will try that later today.

I attached in jpg the error message
Hi. If a C&R doesn't work, you might try exporting your objects into a new db file.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-10-2019, 09:37 AM   #7
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,271
Thanks: 15
Thanked 1,595 Times in 1,515 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: duplicate index

I'm not sure we're all speaking the same language.

If your key is an autonumber, it is possible that the seed has become corrupted and is generating a number less than the highest autonumber +1. If this is the problem, we can post code that will reset the seed for you. Normally C&R will not fix this problem.

If the error is prompted by a different field, then, maybe the data is missing or there is some other error.

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Old 10-11-2019, 04:26 AM   #8
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Re: duplicate index

The compact and repair on the Back End fixed the issue.
Whew.
Thanks for all your help.
jedder18 is offline   Reply With Quote
Old 10-11-2019, 04:30 AM   #9
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,239
Thanks: 94
Thanked 2,026 Times in 1,973 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: duplicate index

Glad to hear you have resolved the issue.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Old 10-11-2019, 05:17 AM   #10
AccessBlaster
.
 
Join Date: May 2010
Posts: 1,226
Thanks: 29
Thanked 282 Times in 268 Posts
AccessBlaster has a spectacular aura about AccessBlaster has a spectacular aura about
Re: duplicate index

I wonder what caused it and how long before it returns. Generally I get this error because of something I configured wrong within the primary key properties. Or I tried to add records after reconfiguring the primary key properties.
AccessBlaster is offline   Reply With Quote
Old 10-11-2019, 05:47 AM   #11
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,239
Thanks: 94
Thanked 2,026 Times in 1,973 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: duplicate index

?? Difficult to say, but I'd make sure I had a good procedure for backing up the BE regularly, and a copy of the front end in a safe place.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Old 10-11-2019, 06:26 AM   #12
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,926
Thanks: 57
Thanked 1,296 Times in 1,277 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: duplicate index

Quote:
Originally Posted by AccessBlaster View Post
I wonder what caused it and how long before it returns. Generally I get this error because of something I configured wrong within the primary key properties. Or I tried to add records after reconfiguring the primary key properties.
Hi. Some possible causes and fixes are mentioned in this article.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-11-2019, 07:11 AM   #13
AccessBlaster
.
 
Join Date: May 2010
Posts: 1,226
Thanks: 29
Thanked 282 Times in 268 Posts
AccessBlaster has a spectacular aura about AccessBlaster has a spectacular aura about
Re: duplicate index

Yeah, Allen Browne is the man.

AccessBlaster is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Index or duplicate key violation XV1957 Modules & VBA 8 04-01-2015 06:35 AM
Duplicate values in index primary key....... Blitznb Forms 2 06-07-2011 05:18 PM
Duplicate Values in the Index rs2004 Forms 7 03-13-2005 04:21 PM
Index (duplicate values VWilson39 Tables 4 09-09-2002 01:20 PM
[SOLVED] Duplicate Index error AngelaMC Forms 1 11-19-2000 06:15 AM




All times are GMT -8. The time now is 10:33 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World