Macro to check the gaps in the records numbering and fill (1 Viewer)

pinky

Registered User.
Local time
Yesterday, 21:21
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
 

KenHigg

Registered User
Local time
Today, 00:21
Joined
Jun 9, 2004
Messages
13,327
Is the field/number you are trying to re-order a primary or foreign key? Is it an autonumber?
 

pinky

Registered User.
Local time
Yesterday, 21:21
Joined
Jul 6, 2009
Messages
29
It is an Auto number field
 

KenHigg

Registered User
Local time
Today, 00:21
Joined
Jun 9, 2004
Messages
13,327
Did you ever get this resolved?
 

Access_guy49

Registered User.
Local time
Today, 00:21
Joined
Sep 7, 2007
Messages
462
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.
 

KenHigg

Registered User
Local time
Today, 00:21
Joined
Jun 9, 2004
Messages
13,327
I subscribe to the notion that depending autonumber for a logical sequence in bad juju. Period. ?
 

Users who are viewing this thread

Top Bottom