Hi John
It's a common trap to fall into with Access. I always have an autonumber field called AutoID in each table and a seperate Primary key field such as CustomerID. When a record is added to the table, I use VB to make CustomerID = AutoID, thus ensuring the primary key is unique. This means that if you ever need to transfer data from one table to an empty table of the same structure, you don't have to worry about which Auto Numbers are generated, because they aren't related to other tables. If you paste a large number of records into a new table, you will have to syncrhonise the AutoID with the CustomerID to ensure your VB code does not try to create duplicate keys. I do this in code as shown below. The following sub adds a new AutoID field to an existing table which effectively frees your current primary key field which you should change to a long integer. Please note you will have to temporarily delete the relationships to the table you are adding the AutoID field to to make sure no related records are deleted in the process.
Sub AddAutoNumber(TableName As String, KeyName As String)
On Error GoTo err_trap
Dim dbs As Database, rst As Recordset
Dim tdf As TableDef, fld As Field, fldIndex As Field, idx As Index
Dim strSQL1 As String, strSQL2 As String
Dim strSQL3 As String, strSQL4 As String
Dim strTempName As String, booAutoTrue As Boolean
Dim intCount As Integer, intMaxFld As Integer
Dim intOffset As Integer, lngLastID As Long
Set dbs = CurrentDb
With dbs
Set tdf = .TableDefs(TableName)
strTempName = tdf.Name & "~tmp"
intCount = 0
intMaxFld = tdf.Fields.Count
booAutoTrue = False
strSQL1 = "SELECT "
'build SQL strings
For Each fld In tdf.Fields
If fld.Attributes And dbAutoIncrField Then booAutoTrue = True
intCount = intCount + 1
strSQL1 = strSQL1 & "[" & tdf.Name & "].[" & fld.Name & "]"
strSQL2 = strSQL2 & "[" & fld.Name & "]"
strSQL3 = strSQL3 & "[" & strTempName & "].[" & fld.Name & "]"
strSQL1 = strSQL1 & IIf(intCount < intMaxFld, ", ", " "

strSQL2 = strSQL2 & IIf(intCount < intMaxFld, ", ", " "

strSQL3 = strSQL3 & IIf(intCount < intMaxFld, ", ", " "

Next
If booAutoTrue Then
MsgBox "Table already contains Autonumber!", vbInformation
Exit Sub
End If
'create temporary table and insert existing data
strSQL1 = strSQL1 & "INTO [" & strTempName & "] FROM " & "[" & tdf.Name & "];"
.Execute strSQL1
'empty original table
strSQL1 = "DELETE * FROM [" & tdf.Name & "];"
.Execute strSQL1
'create indexed autonumber field
Set fld = tdf.CreateField("AutoID", dbLong)
fld.Attributes = fld.Attributes + dbAutoIncrField
tdf.Fields.Append fld
Set idx = tdf.CreateIndex("AutoIndex"

Set fldIndex = idx.CreateField("AutoID", dbLong)
idx.Fields.Append fldIndex
idx.Unique = True
tdf.Indexes.Append idx
'copy data back into original table
strSQL4 = "INSERT INTO [" & tdf.Name & "] ( " & strSQL2 & "

"
strSQL4 = strSQL4 & "SELECT " & strSQL3 & "FROM [" & strTempName & "] "
strSQL4 = strSQL4 & "ORDER BY " & KeyName & ";"
.Execute strSQL4
'refresh tables collection and delete temporary table
With .TableDefs
.Refresh
.Delete (strTempName)
.Refresh
End With
'add records in order to syncronise ID fields
Set rst = .OpenRecordset(tdf.Name)
With rst
.MoveLast
lngLastID = .Fields(KeyName)
intOffset = lngLastID - !Autoid
For intCount = 1 To intOffset
.AddNew
.Fields(KeyName) = lngLastID + intCount
.Update
Next
.Close
End With
'delete additional records
strSQL1 = "DELETE * FROM " & tdf.Name & " WHERE "
strSQL1 = strSQL1 & "([" & KeyName & "] > " & lngLastID & "

;"
.Execute strSQL1
End With
Exit Sub
err_trap:
MsgBox "Error adding autonumber field in table " & TableName & ".", vbCritical
End Sub