Results 1 to 4 of 4
  1. #1
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78

    dbSeeChanges

    I have the following code which use dbSeeChanges but I'm still getting the error:
    "Updating Data Error: 3622 You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column."


    Code:
            
    Dim sMReqs As String
    sMReqs = "(select dbo_tbl_MultipleRequests.RequestID from dbo_tbl_MultipleRequests " & _
                   " where dbo_tbl_MultipleRequests.[txtProjectNumber] = '" & Me.txtProjectNumber & "')"
    
    
          Set Records = db.OpenRecordset(sMReqs, , dbSeeChanges)
                If Records.RecordCount > 0 Then


  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,570
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    It would help if you show us the entire code including the declarations. What happens if you try this:
    Code:
    Dim db as DAO.Database  
    Dim Records as DAO.Recordset
    Dim sMReqs As String
    
    
    Set db=CurrentDb
    sMReqs = "Select dbo_tbl_MultipleRequests.RequestID from dbo_tbl_MultipleRequests " & _
                   " where dbo_tbl_MultipleRequests.txtProjectNumber = '" & Me.txtProjectNumber & "'"
    
    
    Set Records = db.OpenRecordset(sMReqs,dbOpenDynaset , dbSeeChanges)
    
    
    If Records.RecordCount > 0 Then
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    Thank you, I figured out the issue was because I had RS as DAO.Recordset for all the queries in my code and changed it for this one, I don't know why. This worked and helped me move on

    Code:
            Set RS = db.OpenRecordset(sMReqs, dbOpenDynaset, dbSeeChanges)
            
    
    
                If RS.RecordCount > 0 Then
    Thank you for the clarification

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-12-2017, 11:34 AM
  2. Replies: 3
    Last Post: 07-08-2015, 02:33 PM
  3. dbSeeChanges does not fix openrecordset error
    By lringstad in forum Access
    Replies: 1
    Last Post: 12-03-2013, 03:33 PM
  4. Use dbseechanges option with openrecordset
    By spleewars in forum Programming
    Replies: 3
    Last Post: 05-22-2012, 04:19 PM
  5. dbSeeChanges
    By swagger18 in forum Programming
    Replies: 3
    Last Post: 11-23-2011, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums