Macro to check the gaps in the records numbering and fill

pinky

Registered User.
Local time
Today, 05:01
Joined
Jul 6, 2009
Messages
29
hi,
Can anyone let me know how to write a macro which checks the gaps in the records numbering and make it sequential. My Idea was that It should check for the missing numbering in that column. Then check for the highest number and change it to lowest Number+1 and go one incrementing the rows in a column.
There may be morw easiest ways to do this. Can anyone let me know how can we do this?

Thank You,
Pinky
 
Is the field/number you are trying to re-order a primary or foreign key? Is it an autonumber?
 
It is an Auto number field
 
Would it not be much esier, and very simple, to ADD a new field to the table, and make it an autonumber field, that way all recs will be numbered sequentially when you open the table.. if you need the specific field due to relationships...(which i hope you don't because you were planning on recalculating a bunch of records anyways..) Then you could always just calc the old field to equal the new field.

Otherwise... just add the new autonumber field and delete the old one.
 
I subscribe to the notion that depending autonumber for a logical sequence in bad juju. Period. ?
 

Users who are viewing this thread

Back
Top Bottom