Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber properties problem

Status
Not open for further replies.

jaegca

Instructor
Dec 5, 2001
20
US
Primary Key field - autonumber properties set to RANDOM and formatted to 3 digits(000)suddenly (after upgrade to Windows 2000 from 95) generates >8 numbers when new record added-- some of them negative!
 
Hiya,

Don't know much about RANDOM autonumber, but you're obviously using it for user reference, i.e. the user actually uses this number for business purposes (you ARE
formatting it).

It seems to be a conversion bug, therefore, can you not take off all formatting in the '95 version of the table and then convert?

If not, how are you actually 'converting'?

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
'm still kinda new to Access and actually I didn't create the Db - I'm just supposed to fix it. I do know better than to use the autonumber field for anything meaningful. The Db was created in Access 97 and even though we upgraded to Windows 2000 OS we are still using Access 97. When you say conversion are you saying we would have to convert b/c of the operating system upgrade? And if so,can you direct me towards a resource to learn more about this.
Thanks so much, jaegca
 
jaegca,

The formatting that's done with autonumbers is just window dressing--the actual number won't have leading zeroes, etc. If it's just formatting then it shouldn't be a problem (but the negatives wouldn't be a formatting issue...). Did the field size property for the autonumber field get set to "Replication ID" ? This would give you larger numbers. From Access help:

Note, however, that an AutoNumber field with a Replication ID field size produces a 128-bit value that will require more disk space.


Does the autonumber need to be random rather than incremental? (I can't think of a reason but that's just me.)

You can append existing autonumber/PK records from a table into a new table with an autonumber/PK field, preserving the existing #'s (provided they're unique). Migrating the data into new tables with a sequential autonumber (parent tables first then children) might be the ticket. Jeff Roberts
Analysis, Design, & Implementation
RenaissanceData.com
 
Dear Jaegca,

An autonumber is a long value (4 bytes in size) by default. If you set it to random, it will produce semi-random values in this field whenever a new record is created. These values can be quite large (2^31 to be exact) and also be negative. Your formatting only changes the appearance, not the values themselves.

Best regards [smarty]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top