Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009
    Posts
    5

    Unanswered: Runtime Error 3197- record changed by other user, please help

    I have tried various suggestions related to this problem on the messageboards but can't seem to fix it. Keep getting error that records are being accessed at the same time I am deleting but it is a single user application with one form I am currently on and nobody else is changing records. Below is my code, any suggestion appreciated.

    Code:
    Private Sub cmdDelete_Click()
    Dim strMsg As String
    Dim rst As ADODB.Recordset
    Dim obj_connect As ADODB.Connection
    Dim obj_command As ADODB.Command
    Dim strCon As String
    Dim strsql As String
    Dim strSerial As String
    Dim Response
    Dim strTcpip As Variant
    
        Set obj_connect = New ADODB.Connection
        Set obj_command = New ADODB.Command
        Set rst = New ADODB.Recordset
        
        strCon = GetConnectionString() 
        obj_connect.Open strCon
        obj_command.CommandType = adCmdText
        
        strTcpip = Me.TCP_IP_Address.Value
        strSerial = Me.RecordID.Value
        
        If (IsNull(strTcpip)) Or (strTcpip = "") Then
            
            Response = MsgBox("Do You Want To Delete This Printer From Inventory?", vbYesNo + vbInformation, "Warning")
            If Response = vbYes Then
            
                 strsql = "DELETE FROM [Network and Local Printers] WHERE RecordID='" & strSerial & "'"
                 obj_connect.Execute (strsql)
                 Me.Requery
                    
            End If
        
        Else
            
            Response = MsgBox("This Printer Has A TCP/IP Address, Please Contact The Network Printers Administrator For Deletion?", vbOKOnly + vbCritical, "Cannot Delete Printer")
               
        
        End If
        
        Exit Sub
    
    End Sub

  2. #2
    Join Date
    Jul 2009
    Posts
    5

    fixed

    sorry about post, managed to fix this issue.. didn't realize records weren't being updated on the changed event of text boxes which would obviously screw up entries and make the form data different from the database, whoops!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •