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!

How to update An autoNumber field in the table, when I erase a ligne

Status
Not open for further replies.

nadjib

Programmer
May 14, 2003
23
0
0
CA
Hi everybody,

I have tow problems with My first recordest in my table. This recordest is AutoNumber type. So, At each time when i add a new recordests from an associated Form to this table, the recordest is incremented in the table automatically: 1, 2, 3, ..., n.

My problem is I Do not know how can I Update this field, when I erase a ligne in this table. So I want to obtain :

example: 1, 2, 3 ... , When i drop ligne 2, I want to obtain 1, 2 and not 1, 3 ..

Thanks for assistance

nadjib
 
Why bother?

Think like this... 100k records, you delete rec 3, 193, and 18239.

Each delete you need to update the 'unique' ID (autonumber) to make a clean sequence.

Most Autonumbers are for your reference and not for the users, in which case as long as they are unique ... It won't matter whether there are numbers missing. Besides you have between 0 and 2 billion on an autonumber. Are you likely to use more than this??


Vince
 
Hi vince,

I think that you did not understand my problem. Indeed, my table is specific, since the order of appearance of the lines (corresponding of the Autonumber) is very significant in my case.

In my application the user can check this table to see the order of evolution of this table... !! Then, if it sees 1, 3, 45, it will not be able to understand the evolution of this application (because each new add signify the number of evoltion (version) of a modification on a machining element).

So, what I will to have it is a logical automatic incrementing, 1, 2, 3...., NOT 1, 25, 35

nadjib
 
Vince is right. Do not worry about the numbers. If you need to see a specific order, calculate it. If nothing else use me.absoluteposition which is one of the recordset properties. That may not be the exact protocol but it is close and you can find the exact with the wiz.


rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top