M
ms
i have a select query that returns a recordset. in my form
code (command button click), i loop through the rs and
create an update sql statement using some of its field
values. if i use .execute it tells me it
needs 'dbSeeChanges' in openrecordset. I already have the
option specified!! if i change the code to .runsql it
works fine. i'd prefer to have the extra options available
(through .execute) though. any ideas what the problem
might be? i've been experimenting all day and having
gotten anything else to work.
here's some code snippets.
Private Sub cmdBtn_Click()
Dim rsProj As Variant
Dim d As Database
Set d = CurrentDb
Set rsProj = d.OpenRecordset("qryItem_Value",,dbSeeChanges)
rsProj.MoveFirst
While Not rsProj.EOF
SQL = "UPDATE items SET p00_value=" & rsProj!p00_value
DoCmd.RunSQL SQL 'works
'd.Execute SQL 'does not work
rsProj.MoveNext
Wend
rsProj.Close
Set d = Nothing
End Sub
i tried other ways like using
Dim qdf As QueryDef
Set qdf = d.QueryDefs("qryItem_Value")
but get the same error.
many thanks in advance.
ms
code (command button click), i loop through the rs and
create an update sql statement using some of its field
values. if i use .execute it tells me it
needs 'dbSeeChanges' in openrecordset. I already have the
option specified!! if i change the code to .runsql it
works fine. i'd prefer to have the extra options available
(through .execute) though. any ideas what the problem
might be? i've been experimenting all day and having
gotten anything else to work.
here's some code snippets.
Private Sub cmdBtn_Click()
Dim rsProj As Variant
Dim d As Database
Set d = CurrentDb
Set rsProj = d.OpenRecordset("qryItem_Value",,dbSeeChanges)
rsProj.MoveFirst
While Not rsProj.EOF
SQL = "UPDATE items SET p00_value=" & rsProj!p00_value
DoCmd.RunSQL SQL 'works
'd.Execute SQL 'does not work
rsProj.MoveNext
Wend
rsProj.Close
Set d = Nothing
End Sub
i tried other ways like using
Dim qdf As QueryDef
Set qdf = d.QueryDefs("qryItem_Value")
but get the same error.
many thanks in advance.
ms