Private Sub update ()
Dim db As Database
Set db = CurrentDb
Dim rs As Recordset
Set rs = db.OpenRecordset("SELECT * From Table", dbOpenDynaset, dbSeeChanges)
db.Execute ("UPDATE Table SET Path = '" & A.Value & "' WHERE B = '" & B.Value & "'")
db.Close
End Sub
When I got vba access Error 3622 (i.e use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column) a proposed solution was to add the first line (Set rs=... see above in the coding) which I did but it did not resolve the problem. Is there another way to avoid this error ?
I am new in coding and would appreciate any help on this. Thank you.
Since OP has disappeared - add dbSeeChanges to the end of the command (VBA):
DBEngine(0)(0).Execute "UPDATE Table SET Path = '" & A.Value & "' WHERE B = '" & B.Value & "'", dbSeeChanges
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With