Terry,

Don't feel like you HAVE to use CFUpdate. CFUpdate is good for simple
things. By forcing yourself to stick to CFUpdate, you are forcing
yourself into a certain mind set that acutally makes updating multiple
records at one time harder (in my opinion and limited understanding of
CFUpdate).

Assuming that task checkboxes are all named the same (and are called
something like "taskid") where each checkbox holds the unique ID of the
individual task or task type, you could do something like this:

<cfquery>
        DELETE FROM
                [TASK_TABLE_NAME]
        WHERE
                taskid IN ( #FORM.taskid# )
        AND
                <!--- Something that limits this to only one project.
--->
                projectid = #[???SOMETHING_GOES_HERE???]#
</cfquery>

This will delete all tasks with an ID of any checkbox that was checked.
However, this will bomb if no checkbox was checked as the IN() statement
will not have anthing in it. That is why I sometimes do something like:

Taskid IN ( #ListAppend( FORM.taskid, 0 )# )

This will insure that there is always SOMETHING in the IN() directive,
even if that something is "0". 

Does that help at all? 

Or you could do some sort of LIST LOOP where the list is the IDs of the
checkboxes. Then you could attack each task on its own.


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: terry thon [mailto:[EMAIL PROTECTED] 
Sent: Sunday, December 03, 2006 4:51 PM
To: CF-Talk
Subject: Updating several records at one time

I am having difficulting updating several records on a form into my
database.
I know how to <cfupdate> one record at a time.

Form 1 : List of standard tasks for projects:

taskid, laborcode,task, manhrs, nostaff

I would like to have a form with a checkbox where checked the task would
be removed from the project

Form 2: process the form.

I need help with the loop / cfupdate

Many thanks in 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262692
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to