dbseechanges problem Update Query

Posted on 2012-08-30
Last Modified: 2012-08-30
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?
Question by:HKFuey
    LVL 61

    Accepted Solution

    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


    Author Closing Comment

    Hi mbizup, thanks very much!
    I had brackets round like this: (Sql, dbSeeChanges)  easy when you know!
    LVL 61

    Expert Comment

    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


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now