duplicate index (1 Viewer)

jedder18

Just Livin the Dream!
Local time
Today, 07:44
Joined
Mar 28, 2012
Messages
135
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?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:44
Joined
Feb 19, 2013
Messages
16,555
by autogenerated, do you mean an autonumber?

And have you checked the table design for fields set to 'indexed, no duplicates'
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:44
Joined
Jan 23, 2006
Messages
15,364
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 --
 

jedder18

Just Livin the Dream!
Local time
Today, 07:44
Joined
Mar 28, 2012
Messages
135
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
 

Attachments

  • duperror.JPG
    duperror.JPG
    28.3 KB · Views: 134

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:44
Joined
May 7, 2009
Messages
19,175
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:44
Joined
Oct 29, 2018
Messages
21,358
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.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:44
Joined
Feb 19, 2002
Messages
42,984
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.
 

jedder18

Just Livin the Dream!
Local time
Today, 07:44
Joined
Mar 28, 2012
Messages
135
The compact and repair on the Back End fixed the issue.
Whew.
Thanks for all your help.
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:44
Joined
Jan 23, 2006
Messages
15,364
Glad to hear you have resolved the issue.
 

AccessBlaster

Registered User.
Local time
Today, 07:44
Joined
May 22, 2010
Messages
5,828
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.
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:44
Joined
Jan 23, 2006
Messages
15,364
?? 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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:44
Joined
Oct 29, 2018
Messages
21,358
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.
 

Users who are viewing this thread

Top Bottom