Append Query

orna

Registered User.
Local time
Today, 16:12
Joined
Oct 13, 2002
Messages
78
I have an append query to a table that has an autonumber as a primary key.
Usually it works fine but sometimes it gives an error message says that X records could't be appended becouse of key violation, and evry time the X recordes is
different number. After 10-20 attempts the query appends all records.
It's clear to me that the problem is not the data, but what else can it be?!:(

TIA
 
You aren't including the primary key field in the append query are you?
 
Sure not !
 
It does sound odd. I would have expected the same result each time it was run. Does the query append some of the records each time until they eventually are all appended?

Are there any joins or relationships between the source of the appended records and the destination table?
 
Sure not !

It could then be that the autonumber has gotten confused and is trying to append a record with an existing number. Try taking ONE record and append INCLUDING the primary key (set it like this:

FIELD: Expr1:1399
TABLE:
SORT:
APPEND TO: YourTableNameHere
CRITERIA:
OR:


I put 1399 but put the next number that the autonumber should be. This should "reseed" it. You append the one record and then you should be able to go do the rest afterwards.
 
If I let it, some records can be appended and both ways it dosen't matter to the next time the query is activeted.
 
If I let it, some records can be appended and both ways it dosen't matter to the next time the query is activeted.
Like I said, try actually reseeding the autonumber like I showed and then see if it doesn't continue to work.
 
Thanks Bob & Galaxiom
I found out that the autonumber is confused and fixed it as Bob suggest.
 

Users who are viewing this thread

Back
Top Bottom