X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Runtime Error 3622, Access 2016    
post Mar 26 2020, 02:28 PM

Posts: 8
Joined: 15-August 18

I've moved my back-end database to SQL and am having trouble fixing an error that occurs. The error is "You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column. My code copies data from a previous record and puts in a form for a new record. Then a message box asks if you really want to make a copy of the record. If you select no, it runs a SQL string to delete the new record from the table. I get the error when it try to run the following SQL string. This worked fine when it was an Access backend. Can someone point me in the right direction on what I need to change to have this work with SQL?

Dim strMsg As String
    strMsg = "Are you sure you want to copy the report " & Me![AuditReportNumber] & "? "

    If MsgBox(strMsg, vbYesNo) = vbNo Then
        strSQL = "DELETE * " & _
         "FROM [ProjectReports] " & _
         "WHERE [AuditReportNumber]='" & [Forms]![EditReport2]![AuditReportNumber] & "'"

    CurrentDb.Execute strSQL, dbFailOnError
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    5th July 2020 - 11:33 AM