Update Statement VBA Access

hazeleyre23

Registered User.
Local time
Today, 13:45
Joined
Apr 6, 2016
Messages
18
Hi,

I am trying to use an UPDATE statement in VBA.

Below is my code, however when I try run it, I am getting an error message.

Code:
currentdb.Execute "Update dbo_Agent_Data set ToDate = #" & me!txtUpdateToDate & "# WHERE id_new = " & me!txtUpdateID

the error message I am getting is:

"You must use the dbSeeChanges option with OpenRecordSet when accessing a SQL Server table that has an IDENTITY column"

My Identity column column is ID, this is also my Primary Key. Not sure what I need to do next....

Thank you
 
then add that in your update sttatement:

currentdb.Execute "Update dbo_Agent_Data set ToDate = #" & me!txtUpdateToDate & "# WHERE id_new = " & me!txtUpdateID, dbSeeChanges
 
docmd.runSql "update dboagent..."
 

Users who are viewing this thread

Back
Top Bottom