PC Review


Reply
Thread Tools Rate Thread

AutoNumber correlate with Number?

 
 
MikeF
Guest
Posts: n/a
 
      27th Mar 2009

In tblCompanies, CompanyID is a "Number" field, non-primary key.
I changed it to this temporarily, as it was being rebuilt in a new db, and
all the old Access2002 id's were replicated, so record #524 had a CompanyID
of
-21118374650238347.

At any rate, it's now in Access2007, all links/lookups are restored to the
CompanyID field, which is numbered 1 to 1000 [this example contains 1000
records].

So, thought it would be easy to change the CompanyID from Number to
AutoNumber w/PK.
Changed CompanyID field to CompanyIDx, sorted ascending, order on load.
Added CompanyID, AutoNumber w/PK.

It comes up in a completely different sort order.
Ie record 1 from CompanyIDx is record 626 in CompanyID, and so on.
Really need the numbers to be equal/correlate in each field.
[Then I can delete the CompanyIDx field and the table is done.]

So far no luck at all after a dozen different attempts.
Can anyone assist?

Thanx in advance.
- Mike


 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      27th Mar 2009
MikeF wrote:

>
>In tblCompanies, CompanyID is a "Number" field, non-primary key.
>I changed it to this temporarily, as it was being rebuilt in a new db, and
>all the old Access2002 id's were replicated, so record #524 had a CompanyID
>of
>-21118374650238347.
>
>At any rate, it's now in Access2007, all links/lookups are restored to the
>CompanyID field, which is numbered 1 to 1000 [this example contains 1000
>records].
>
>So, thought it would be easy to change the CompanyID from Number to
>AutoNumber w/PK.
>Changed CompanyID field to CompanyIDx, sorted ascending, order on load.
>Added CompanyID, AutoNumber w/PK.
>
>It comes up in a completely different sort order.
>Ie record 1 from CompanyIDx is record 626 in CompanyID, and so on.
>Really need the numbers to be equal/correlate in each field.
>[Then I can delete the CompanyIDx field and the table is done.]



Autonumbers are not guaranteed to be anything except unique.
If you want to apply any meaning to an autonumber field OR
if users can see the autonumber, then you should not be
using autonumber.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
dymondjack
Guest
Posts: n/a
 
      28th Mar 2009
There is a way to reset the autonumber seed so it starts on specified number
for you. Go to allenbrowne.com/tips and look for his articles on autonumbers
if you want to try it.

I have to agree with Mashall though... users should never see an autonumber
value and should never be trusted as anything more than a unique value. In
most cases, the actual value of an autonumber shouldn't be the concern of the
programmer, just a number for the application to grab data. If you need a
field to have a purpose to your user see about making a separate field just
for that.

Anyway if you really need to you can see Allen's article on resetting the
autonumber, it should help here.

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill


"MikeF" wrote:

>
> In tblCompanies, CompanyID is a "Number" field, non-primary key.
> I changed it to this temporarily, as it was being rebuilt in a new db, and
> all the old Access2002 id's were replicated, so record #524 had a CompanyID
> of
> -21118374650238347.
>
> At any rate, it's now in Access2007, all links/lookups are restored to the
> CompanyID field, which is numbered 1 to 1000 [this example contains 1000
> records].
>
> So, thought it would be easy to change the CompanyID from Number to
> AutoNumber w/PK.
> Changed CompanyID field to CompanyIDx, sorted ascending, order on load.
> Added CompanyID, AutoNumber w/PK.
>
> It comes up in a completely different sort order.
> Ie record 1 from CompanyIDx is record 626 in CompanyID, and so on.
> Really need the numbers to be equal/correlate in each field.
> [Then I can delete the CompanyIDx field and the table is done.]
>
> So far no luck at all after a dozen different attempts.
> Can anyone assist?
>
> Thanx in advance.
> - Mike
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-number an Autonumber ADonMS Microsoft Access Database Table Design 4 12th Oct 2009 08:10 PM
Row Number or AutoNumber? =?Utf-8?B?RGF2ZQ==?= Microsoft Access Queries 4 7th Oct 2008 08:56 PM
correlate volume number to disk ? Beemer Biker Storage Devices 2 19th Mar 2006 04:22 PM
Turning number field to autonumber at a certain number Douglas J Steele Microsoft Access 6 21st Jun 2005 10:59 PM
Number to AutoNumber Adri Microsoft Access 4 18th May 2005 03:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:49 PM.