Renumbering?

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

Here's my problem. I have a table of 400 questions with a
field for catagories(drop down list with 4 selections).
It also has a auto# field which is the primary key. The
questions where entered in the order I wish to ask them,
now I see the need add a question, but would like to put
it in a certian place (say between question 7 & 8) but
now I want that question to become #8 and the ones after
#8 question to be renumbered. Can any one help here?
Thanks
Rick
 
Not straightforward if you rely on the autonumber for the sorting:
Create a new table (empty copy of original)
INSERT all records prior to the 1 you want to insert
INSERT the New Record
INSERT the remainder
Empty the Original
INSERT all records from copy
Tip: you can multiply the new table(s) pk by a factor (say 100) to make room
for later "refills" when moving the data back

With a seperate counter field
create a recordset (in code) with order by set to descending & approperiate
where clause
Update the sorting field to value +1

HTH

Pieter
 
Back
Top