This is a contination of http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27300989.html#36514583
, where one of my tables got corrupt, and cannot copy "Structure and Data", as it gives me Record is deleted, but rather i need to copy structure only, then open the original table select all records and paste them into y new empty table.
For the record deleted, this workarround works, but now the problem is my IDs are all different, where in my ids are 1 through 8776, where in my old table the ids are 3613 through 13416.
I understand why in the new numbers are 1 through 8776, but just to explain the numbers in my old table... IDs 1 through 3612was 2010 data and was backed up and removed. 1,037 records wer started, but cancelled, and Acccess obviously destroys that number,
My question is, how can I copy all records to my new table, while preserving the current ID#s, and still continuing Auto# after pasting? I really want to avoid adding a new field, as i;ll need to change many lines of code.
The only way I can think of is writing a one-time routine that resembles the below psedo code, but I'm not sure if it will work for this number of records and i'm worndering if thers an easioer way?
rsOld.Open SELECT * order by id
maxID = rsOld!id
for newRec = 1 to maxID
lbl.Caption = Updating newRec of maxID <-- so i know it isnt frozen
If newRec <> rsOld.id
Cancel rsNew.AddNew to loose # <-i'm not sure the code for this? If there's no code, i can just put an arbitery field in some field, then delete those records
rsNew.Field1 = rsOld.Field1
rsNew.Field2 = rsOld.Field2