Adding Multiple Recordset Fields?

Results 1 to 2 of 2

Thread: Adding Multiple Recordset Fields?

  1. #1
    Join Date
    Dec 1969

    Default Adding Multiple Recordset Fields?

    In my form I use this kind of code<BR><BR>&#060;input type="text" value="&#060;%rs("field&#060;%=x%&#062;")%&#062;"& #062;<BR><BR>And then in my update script I use<BR><BR>this:<BR><BR>& " field = &#039"&request.form("field"&x)&"&#039<BR><BR>So that data inserted into the form, displays in multiple rows, and is updated if the user changes anything, back into multiple recordsets.<BR><BR>Like this<BR><BR>Item Name Quantity UnitPrice <BR>1 Car 3 $10,000 <BR>2 Truck 5 $15,000<BR><BR>But now I need to add two or more fields together.<BR><BR>How would I create a variable that would add all the entries from a field together and insert that value into the table along with the update? Like adding all the UnitPrices into a subtotal. Or adding the number of Cars and Trucks together.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Adding Multiple Recordset Fields?

    &#060;input type="text" value="&#060;%rs("field&#060;%=x%&#062;")%&#062;"& #062;<BR><BR>this is completely invalid. <BR><BR>try this<BR><BR>&#060;input type="text" value="&#060;%rs("field" & x) %&#062;"&#062;<BR><BR>what you&#039re attempting is reasonably simple, just think it through a little. Hint : CInt(rs("field")) will give you a usable integer value or CDbl() will give you something that uses decimal places<BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts