duplicate index

jedder18

Just Livin the Dream!
Local time
Yesterday, 22:34
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?
 
by autogenerated, do you mean an autonumber?

And have you checked the table design for fields set to 'indexed, no duplicates'
 
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 --
 
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: 206
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
 
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.
 
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.
 
The compact and repair on the Back End fixed the issue.
Whew.
Thanks for all your help.
 
Glad to hear you have resolved the issue.
 
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.
 
?? 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.
 
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

Back
Top Bottom