Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Rows missing from old table with no primary key

    I have an old table from a database with 2000+ rows deleted and it had no primary key (but it had a number column).

    I am splitting another old table which relies on the number column of that old table but I am importing it into a new table with an autonumber primary key which the split table will rely on.

    Thing is I need the number and the autonumber to match up accross all records

    1 has to be 1


    2 has to be 2 and so on

    is there a way to "fill" in rows with the missing numbers? i.e. if I have 1,2,3 and 2 is missing the method adds a row "2" to the table.

    as you can see ... I have a problem

    Click image for larger version. 

Name:	Capture.JPG 
Views:	4 
Size:	20.0 KB 
ID:	13734 Click image for larger version. 

Name:	Capture2.JPG 
Views:	4 
Size:	17.2 KB 
ID:	13735

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Also if this helps, if the other table can have their records match oldSchoolsID (that is what they used to be related to) but then updated to the new ID from auto field that would be better - saves me having to worry about inserting rows.

    so tblBookings instead of 2613 now gets 2616 in its row field

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Nevermind answered my own question and I am stoked.

    I added a field and updated it with the autonumber from the other table and it matches so I am not worried about retaining the old ID and can use the new one.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	3 
Size:	38.5 KB 
ID:	13736

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-14-2012, 01:37 AM
  2. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  3. Annoying error on macro export to excel - missing rows
    By Blueweasel in forum Import/Export Data
    Replies: 0
    Last Post: 12-15-2011, 04:41 AM
  4. Replies: 1
    Last Post: 06-01-2009, 01:09 PM
  5. Replies: 0
    Last Post: 11-16-2008, 09:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums