This topic is locked

Update next record in same table

6/13/2006 9:03:05 AM
ASPRunnerPro General questions
B
barljo00 author

When the current record is updated by the user, I have a routine to find the next record already completed and carry forward some of the fields in the AfterEdit event. The code I'm using for this is:
'**** get next months status record to update
strSQLExists3 = "select * from MonthlyReleaseStatus where PRCost_Month = " & iNextMonth
set rsExists3 = CreateObject("ADODB.Recordset")
rsExists3.Open strSQLExists3, dbConnection
if not rsExists3.eof then
rsExists3("PRCost_ProjectedBudget").AppendChunk = Session("iPRCost_ProjectedBudget")

Response.Write "; Got here #4"

rsExists3("PRCost_ProjectedCost") = Session("iPRCost_ProjectedCost")

Response.Write "; ready to update"
rsExists.Update
else

Response.Write "; Record not found"

end if
rsExists3.Close : set rsExists3 = Nothing
I can't get past the rsExists3("PRCost_ProjectedBudget").AppendChunk = Session("iPRCost_ProjectedBudget") and have tried numerous combinations. HELP!!
Tks,

Joan

Sergey Kornilov admin 6/14/2006

The following statement doesn't really mean anything. AppendChunck is a function and you cannot assign anything to it.

rsExists3("PRCost_ProjectedBudget").AppendChunk = Session("iPRCost_ProjectedBudget")


Use

rsExists3("PRCost_ProjectedBudget") = Session("iPRCost_ProjectedBudget")


Also you mix rsExists3 and rsExists which won't work as well.