>> I am tiring to update multiple records with different values. > > >It seems as if you are trying to update multiple records with different >quantities and different id's. You would be best to update them one at >a time using cfquery, something like the method I've shown below. > >HTH > ><!--- FORM >------------------------------------------ ---> ><cfquery name="RequestItemsDetail" datasource="print_shop"> > SELECT > tbl_masterlist.fld_desc > , tbl_865_orders_items.fld_qty_ordered > , tbl_865_orders_items.fld_prod_code > , tbl_865_orders_items.fld_item_ID > , tbl_865_orders_items.fld_qty_shipped > FROM > tbl_masterlist > , tbl_865_orders_items > WHERE > tbl_865_orders_items.fld_wo_num = <cfqueryparam >value="#fld_wo_num#" cfsqltype="cf_sql_integer"/> > and tbl_masterlist.fld_prod_code = >tbl_865_orders_items.fld_prod_code ></cfquery> > > ><form name="whatever" action="whereever" method="post"> > <!--- Loop round all your products and output a quantity field >and hidden id element in order ---> > <cfoutput query="RequestItemsDetail"> > <cfinput type="hidden" >name="fld_item_ID_#RequestItemsDetail.currentrow#" value="#fld_item_ID#" >/> > <cfinput type="text" >name="fld_qty_shipped_#RequestItemsDetail.currentrow#" >value="#(fld_qty_ordered-fld_qty_shipped)#" /> > <br/> > </cfoutput> > > <!--- Output no of records so that know how many to loop over in >action page ---> > <input type="hidden" name="records" >value="#RequestItemsDetail.recordcount#"/> > <input type="submit" name="submit" value="Update"/> ></form> > > ><!--- UPDATE >------------------------------------------ ---> ><!--- Loop over the number of records that were on the previous form >---> ><cfloop from="1" to="#form.records#" index="ii"> > <!--- Get the ID of the product and the quanitity from the order >form ---> > <cfset variables.thisId = form["fld_item_ID_"&ii]/> > <cfset variables.thisQuantity = form["fld_qty_shipped_"&ii]/> > > <!--- Update this product with the new id ---> > <cfquery name="setQtystatus" datasource="print_shop"> > update > tbl_865_orders_items > set > fld_qty_shipped = <cfqueryparam >value="#variables.thisQuantity#" cfsqltype="cf_sql_varchar"/> > where > fld_item_ID = <cfqueryparam >value="#variables.thisId#" cfsqltype="cf_sql_integer"/> > </cfquery> ></cfloop>
I works great. Thank you very much!!!! Keith ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:252345 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

