BlackBearDude
Programmer
I've created a record set in which I include (in the SQL) some additional fields (e.g., 0 AS a, 0 AS b, etc.) with the intention of looping through the recordset and filling in these fields with data from other sources.
The recordset is created fine. The problem is the infamous "multiple-step operation generated errors" when trying to update a field in the recorset.
What issues exist in this situation? I thought that updating fields in this fashion would be relatively straight-forward.
Here is the SQL used to create recordset:
strSQL1 = "SELECT [desc], [catid], [amount] AS [budget], 0 AS [actual], 0 AS [pct] " _
& "FROM [catbud] " _
& "WHERE [year] = " & intYear & " AND [depid] = " & intDepID & " " _
& "ORDER BY [desc]"
rs1.Open strSQL1, gcon, adOpenKeyset, adLockBatchOptimistic
Here is the statement that I believe is generating the error:
rs1.Fields("actual"
.Value = IIf(IsNull(rs2.Fields("cost"
), 0, rs2.Fields("cost"
)
The error occurs regardless of the way I try to assign it to rs1.fields("actual"
.
I'm sure that the problem is "right in front of me" and I just can't see it.
I would greatly appreciate any & all help.
Thanks
Patrick
The recordset is created fine. The problem is the infamous "multiple-step operation generated errors" when trying to update a field in the recorset.
What issues exist in this situation? I thought that updating fields in this fashion would be relatively straight-forward.
Here is the SQL used to create recordset:
strSQL1 = "SELECT [desc], [catid], [amount] AS [budget], 0 AS [actual], 0 AS [pct] " _
& "FROM [catbud] " _
& "WHERE [year] = " & intYear & " AND [depid] = " & intDepID & " " _
& "ORDER BY [desc]"
rs1.Open strSQL1, gcon, adOpenKeyset, adLockBatchOptimistic
Here is the statement that I believe is generating the error:
rs1.Fields("actual"
The error occurs regardless of the way I try to assign it to rs1.fields("actual"
I'm sure that the problem is "right in front of me" and I just can't see it.
I would greatly appreciate any & all help.
Thanks
Patrick