Jumat, 06 April 2012

Re: [MS_AccessPros] RE: New primary key

 

Hi Bill,

you can add records to a table with defined values for AutoNumber using an Append Query.

If you want AutoNumbers back:

1. break relationships on current table.

2. make a copy of the table with no records.
3. change field to AutoNumber
4. set relationships

5. append records

Warm Regards,
Crystal

 *
   (: have an awesome day :)
 *

________________________________
From: Bill Singer <Bill.Singer@at-group.net>
To: MS_Access_Professionals@yahoogroups.com
Sent: Friday, April 6, 2012 9:38 AM
Subject: [MS_AccessPros] RE: New primary key

I just want to make sure this is possible.

I have table with a primary key,  about 300 records.  The number of the
Primary Key was important as the data was transferred from an excel
spreadsheet and the primary key relates to other storage records.  After
the table was finished a few of the records were deleted.  Now the user
wants those Primary Key numbers back.

I know I cannot just add those numbers in because they are automatically
generated.  I have changed the Auto-Number to  Number, add in the existing
records.  All of that works but I cannot change the field back to
Auto-Number, which I understand. 

So, I keep the table sorted by the old primary key number with the missing
records added, I add a new primary key auto-number field and let it
re-sequence and for some reason it does not sequence in the correct order.

Is there a way to get the new primary key auto-number to sequence in the
same way that the old primary key was sequences?  The auto number value is
what the rest of the relationships are built on and they will all be wrong
if the sequence is not the same.

Thanks for your help.

Bill

MN

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar