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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reorder counter on delete

Status
Not open for further replies.

lizok

Programmer
Joined
Jan 11, 2001
Messages
82
Location
US
hi. i am in trouble. please help. i have a survey. when i add question i have a counter to keep questions in order. e.g question1 -> count=1, question2->count=2. then on INSERT i insert count value alog with a question. so i have rdered list of quesitons. However when i delete 1 question, i need to reorder count values. e.g. 1,2,3,4 if i delete 2 then i have a gap 1,3,4. how can i reorder this counter?
thank you in advance.
liz
 
I assume this is not an autonumber field.

Use a <cfloop> through a query. Starting with the question after the one you deleted, <cfupdate> and set the field of the number to one less.

Hope this helps. The only dumb questions are the ones that are never asked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top