PC Review


Reply
Thread Tools Rate Thread

autonumber from random to incremental

 
 
JT
Guest
Posts: n/a
 
      31st Dec 2009
I cannot change my autonumber from random to incremental. Any sugestions?
please help...
 
Reply With Quote
 
 
 
 
Banana
Guest
Posts: n/a
 
      31st Dec 2009
JT wrote:
> I cannot change my autonumber from random to incremental. Any sugestions?
> please help...


If my memory serves, you can't alter any of autonumber properties once
it's used. You would need to change the original autonumber to a plain
old number, save the table, add a new column and make it an autonumber
with incremental (which should be default anyway), then delete the old
column.

However, this is very risky move because if there are other tables
related to this table, the links will break. In such cases, consider
either using Cascade Update or if the largest number isn't that large,
insert the old values into the new autonumber.

Of course, you made a back-up, right?
 
Reply With Quote
 
Dorian
Guest
Posts: n/a
 
      31st Dec 2009
Try emptying the table then doing a compact/repair then reset the attribute.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"JT" wrote:

> I cannot change my autonumber from random to incremental. Any sugestions?
> please help...

 
Reply With Quote
 
Jerry Whittle
Guest
Posts: n/a
 
      31st Dec 2009
Even if you could, autonumbers are not truely incremental. If you need
something at is incremental with no possibility of a break in the numbering,
do NOT use autonumbers. For example if you start a new record that has an
autonumber field, then change your mind, that autonumber is 'burned' and you
will have a gap. Sometimes Access will pull out an out of sequence
autonumber, including even negative numbers, for no apparent reason even when
set to incremental.

Your best bet is to do a DMax of the primary key field in the table and add
1 to it just before saving the record. For this you need to use a form and
hope that more than one person isn't inputting a new record at the same time.

Other DBMSs have things like Sequences that will truely produce an
incremental number when needed.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"JT" wrote:

> I cannot change my autonumber from random to incremental. Any sugestions?
> please help...

 
Reply With Quote
 
GBA
Guest
Posts: n/a
 
      31st Dec 2009

another approach;

make a new table with all the fields the same....(but with the autonumber
field set to increment)

and then make an append query that puts all the records into this new table...

then change table names...

you'll have to remake fixed relationships...

"JT" wrote:

> I cannot change my autonumber from random to incremental. Any sugestions?
> please help...

 
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
INCREMENTAL NBR VS. AUTONUMBER WHEN APPENDING =?Utf-8?B?VGFuaw==?= Microsoft Access Queries 2 30th Sep 2006 04:11 AM
Incremental and Random =?Utf-8?B?U2hhbHlu?= Microsoft Access 4 6th Apr 2005 12:36 PM
Yet Another Autonumber/Incremental Key Question Joe Williams Microsoft Access Database Table Design 2 8th Dec 2004 12:04 AM
AutoNumber Random Number not Random Brian Microsoft Access Database Table Design 1 27th Mar 2004 03:18 PM
autonumber problem (random vs. incremental) Henricus Microsoft Access Database Table Design 2 6th Feb 2004 08:46 PM


Features
 

Advertising
 

Newsgroups
 


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