• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 669
  • Last Modified:

dbseechanges problem Update Query

I have this code: -

Set Dbs = CurrentDb
Sql = "UPDATE dbo_Mytbl SET dbo_Mytbl.Field=0
Sql = Sql & "WHERE dbo_Mytbl .Key=" & Me!Key
Dbs.Execute (Sql)

The table has an autonumber column and I get error 3622 "You must use seechanges option with OpenRecordset"

Can anyone help?
0
HKFuey
Asked:
HKFuey
  • 2
1 Solution
 
mbizupCommented:
Try this:

Set Dbs = CurrentDb
Sql = "UPDATE dbo_Mytbl SET dbo_Mytbl.Field=0
Sql = Sql & "WHERE dbo_Mytbl .Key=" & Me!Key
Dbs.Execute Sql, dbSeeChanges

Open in new window

0
 
HKFueyAuthor Commented:
Hi mbizup, thanks very much!
I had brackets round like this: (Sql, dbSeeChanges)  easy when you know!
0
 
mbizupCommented:
As an aside, you should also include dbFailOnError so that you get error messages if your SQL statement has issues:

Dbs.Execute Sql, dbFailOnError + dbSeeChanges 

Open in new window

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now