Link to home
Start Free TrialLog in
Avatar of fatbloater
fatbloater

asked on

Autonumber Reset To 1 Without Deleting Current Records

I there a way yo reset the autonumber to 1 without deleting/losing any current data.

ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paurths
Paurths

Avatar of fatbloater

ASKER

But wont i then lose the current number?
The current autonumber is part of a reference that identifies each case, i cant lose this data.
Now its a new financial year i need to reset my reference to 1 but keep the old references.
This is not the PK.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Then I guess it's impossible.
Lol - I just don't type fast enough.
Can't you create a new Long field, update it to the current autonumber values and then follow Dhaest's solution?
btw, why would you want to reset the autonumber when it is part of a relationship?
The autonumber should be used in the background, meaningless to a user.
for your invoices (i guess its that...) you should use (add) another field, and use that one. (index it, but double values must be permitted)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry Paurths - your post wasn't there when I posted...

:-)
The autonumber is used to produce the id, its not the id itself. When someone registers the it looks at the autonumber and coies the number to make th ref.
When i delete it to reset it still puts in values to account for the records that i still have in the table.

I just have to re-type that -

The autonumber is used to produce the id, its not the id itself. When someone registers a record it looks at the autonumber and copies the value to make the ref.
When i delete the autonumber to reset it, it still puts in values to account for the records that i still have in the table.

Thats better ;-)>
So you're using autonumber (indirectly) to mean something to the user....

You shuold generate an ID a different way, if you need it to mean something.

Autonumber can skip numbers and change - particularly after compacting
How would you suggest - there are 8 people using this database.
I tried having a table and adding +1 to it each time, but thought it would be worse -do you think i should go back to this method?
bloater - incrementing the number is the way that i'd go...

:-)