View Full Version : Macro to check the gaps in the records numbering and fill


pinky
04-22-2010, 06:16 AM
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
04-22-2010, 06:40 AM
Is the field/number you are trying to re-order a primary or foreign key? Is it an autonumber?

pinky
04-22-2010, 07:49 AM
It is an Auto number field

KenHigg
04-23-2010, 02:42 AM
Did you ever get this resolved?

Access_guy49
04-23-2010, 06:15 AM
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
04-23-2010, 06:32 AM
I subscribe to the notion that depending autonumber for a logical sequence in bad juju. Period. ?

cyl
04-23-2010, 05:35 PM
Thank you for sharing out